From 0030f0f7807e21caf47261e2828efae2ddafd50a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 17 Jun 1999 12:41:26 +0000 Subject: [PATCH] Expect return alue to be ERANGE if buffer is too small. --- nss/getXXbyYY.c | 7 ++++--- nss/getXXent.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c index 15cdcba3ff..7a52e9d3ba 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 e40d41b51e..497c0dee22 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;