On Tue, Oct 22, 2019 at 10:05:45AM +0200, Peter Eisentraut wrote:
> You probably want something like
> 
>     if (end && *end != ...)

Yes, it looks like a brain fade here.  Conversion failures are tracked
before that, so strtol() would not return NULL for endptr.  The first
part could just be removed as per the attached. 
--
Michael
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 9af830321c..0eeabb8b43 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -1713,10 +1713,10 @@ parse_int_param(const char *value, int *result, PGconn *conn,
 	 * Skip any trailing whitespace; if anything but whitespace remains before
 	 * the terminating character, fail
 	 */
-	while (*end && *end != '\0' && isspace((unsigned char) *end))
+	while (*end != '\0' && isspace((unsigned char) *end))
 		end++;
 
-	if (*end && *end != '\0')
+	if (*end != '\0')
 		goto error;
 
 	*result = numval;

Attachment: signature.asc
Description: PGP signature

Reply via email to