X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=2991b6db5c42b58c0028c371890739323662bba7;hp=c7bb8b4b71293ee89964b55175c2170fb10c3e31;hb=cd0abca282ec1cd29510f4cf8fefb04aa7e20ad7;hpb=d81f6efa05b305c9a8655124b001ea71e1c86679 diff --git a/net.c b/net.c index c7bb8b4b..2991b6db 100644 --- a/net.c +++ b/net.c @@ -203,12 +203,10 @@ __printf_2_3 int send_va_buffer(int fd, const char *fmt, ...) * \param buf the buffer to write the decrypted data to * \param size the size of \a buf * - * Receive at most \a size bytes from filedescriptor fd. If encryption is + * Receive at most \a size bytes from file descriptor \a fd. If encryption is * available, decrypt the received buffer. * - * \return The number of bytes received on success. On receive errors, -E_RECV - * is returned. On crypt errors, the corresponding crypt error number is - * returned. + * \return The number of bytes received on success, negative on errors. * * \sa recv(2) */ @@ -254,8 +252,7 @@ int recv_buffer(int fd, char *buf, size_t size) { int n; - if (!size) - return -E_RECV; + assert(size); n = recv_bin_buffer(fd, buf, size - 1); if (n >= 0) buf[n] = '\0';