diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 9088c4cbce72ea5f272dc0766baaf05bdaadcb9e..84765a79fee8e767c0ec71eecca1b7c0b934f14c 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -1663,6 +1663,8 @@ parse_int_param(const char *value, int *result, PGconn *conn,
 	char	   *end;
 	long		numval;
 
+	Assert(value != NULL);
+
 	*result = 0;
 
 	/* strtol(3) skips leading whitespaces */
@@ -1680,10 +1682,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;