From: Ulrich Drepper Date: Thu, 17 Jun 1999 12:41:26 +0000 (+0000) Subject: Expect return alue to be ERANGE if buffer is too small. X-Git-Tag: cvs/glibc_2-1-2~381 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0030f0f7807e21caf47261e2828efae2ddafd50a;p=thirdparty%2Fglibc.git Expect return alue to be ERANGE if buffer is too small. --- diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c index 15cdcba3ffe..7a52e9d3ba0 100644 --- a/nss/getXXbyYY.c +++ b/nss/getXXbyYY.c @@ -114,12 +114,13 @@ FUNCTION_NAME (ADD_PARAMS) } while (buffer != NULL - && INTERNAL (REENTRANT_NAME) (ADD_VARIABLES, &resbuf, buffer, - buffer_size, &result H_ERRNO_VAR) != 0 + && (INTERNAL (REENTRANT_NAME) (ADD_VARIABLES, &resbuf, buffer, + buffer_size, &result H_ERRNO_VAR) + == ERANGE) #ifdef NEED_H_ERRNO && h_errno_tmp == NETDB_INTERNAL #endif - && errno == ERANGE) + ) { char *new_buf; buffer_size += BUFLEN; diff --git a/nss/getXXent.c b/nss/getXXent.c index e40d41b51e6..497c0dee221 100644 --- a/nss/getXXent.c +++ b/nss/getXXent.c @@ -85,11 +85,11 @@ GETFUNC_NAME (void) while (buffer != NULL && INTERNAL (REENTRANT_GETNAME) (&resbuf, buffer, buffer_size, &result - H_ERRNO_VAR) != 0 + H_ERRNO_VAR) == ERANGE #ifdef NEED_H_ERRNO && h_errno == NETDB_INTERNAL #endif - && errno == ERANGE) + ) { char *new_buf; buffer_size += BUFLEN;