projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
aac audio format handler: fix end of file timeout
[paraslash.git]
/
net.c
diff --git
a/net.c
b/net.c
index 5b754111ed54e892a5f6f0c26aa554414d3bfca1..d4472c0e2805ecb898ef4caae85a96980fe6d447 100644
(file)
--- a/
net.c
+++ b/
net.c
@@
-189,8
+189,11
@@
int recv_buffer(int fd, char *buf, ssize_t size)
{
int n;
{
int n;
- if ((n = recv_bin_buffer(fd, buf, size - 1)) >= 0)
+ n = recv_bin_buffer(fd, buf, size - 1);
+ if (n >= 0)
buf[n] = '\0';
buf[n] = '\0';
+ else
+ *buf = '\0';
return n;
}
return n;
}
@@
-344,7
+347,7
@@
int recv_cred_buffer(int fd, char *buf, size_t size)
{
return recv_buffer(fd, buf, size) > 0? 1 : -E_RECVMSG;
}
{
return recv_buffer(fd, buf, size) > 0? 1 : -E_RECVMSG;
}
-#else
HAVE_UCRED
+#else
/* HAVE_UCRED */
/**
* send NULL terminated buffer and Unix credentials of the current process
*
/**
* send NULL terminated buffer and Unix credentials of the current process
*
@@
-514,8
+517,8
@@
int recv_pattern(int fd, const char *pattern, size_t bufsize)
goto out;
ret = 1;
out:
goto out;
ret = 1;
out:
- free(buf);
if (ret < 0)
if (ret < 0)
- PARA_NOTICE_LOG("did not receive pattern '%s'\n", buf);
+ PARA_NOTICE_LOG("did not receive pattern '%s'\n", pattern);
+ free(buf);
return ret;
}
return ret;
}