X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=net.c;h=b510dc1870e91c3030fc0563d9dc762b7497d782;hb=82ec559332572814f76a8db3ed6751792687570d;hp=60f8e9a1d07cceafa4dcc51bb64ec5ae6b50b82e;hpb=ec22c98399a8317cb8310a343ac0030279b58571;p=paraslash.git diff --git a/net.c b/net.c index 60f8e9a1..b510dc18 100644 --- a/net.c +++ b/net.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Andre Noll + * Copyright (C) 2005-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -728,10 +728,9 @@ int recv_cred_buffer(int fd, char *buf, size_t size) * * \return Positive if \a pattern was received, negative otherwise. * - * This function creates a buffer of size \a bufsize and tries - * to receive at most \a bufsize bytes from file descriptor \a fd. - * If at least \p strlen(\a pattern) bytes were received, the beginning of - * the received buffer is compared with \a pattern, ignoring case. + * This function tries to receive at most \a bufsize bytes from file descriptor + * \a fd. If at least \p strlen(\a pattern) bytes were received, the beginning + * of the received buffer is compared with \a pattern, ignoring case. * * \sa recv_buffer(), \sa strncasecmp(3). */ @@ -739,7 +738,7 @@ int recv_pattern(int fd, const char *pattern, size_t bufsize) { size_t len = strlen(pattern); char *buf = para_malloc(bufsize + 1); - int ret = -E_RECV_PATTERN, n = recv_buffer(fd, buf, bufsize); + int ret = -E_RECV_PATTERN, n = recv_buffer(fd, buf, bufsize + 1); if (n < len) goto out;