Avoid passing signed chars to functions ... same old
authorTom Lane
Wed, 25 Aug 2010 00:53:37 +0000 (00:53 +0000)
committerTom Lane
Wed, 25 Aug 2010 00:53:37 +0000 (00:53 +0000)
portability mistake as always.  Per buildfarm member pika.

src/bin/psql/command.c

index a482010157b43d426ed451337d950dc98406f3ba..6ab65d8b5fe4eb3dd12964b041b3eca3611713ab 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2010, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.228 2010/08/14 14:20:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.229 2010/08/25 00:53:37 tgl Exp $
  */
 #include "postgres_fe.h"
 #include "command.h"
@@ -2452,20 +2452,21 @@ strip_lineno_from_funcdesc(char *func)
     */
 
    /* skip trailing whitespace */
-   while (c > func && isascii(*c) && isspace(*c))
+   while (c > func && isascii((unsigned char) *c) && isspace((unsigned char) *c))
        c--;
 
    /* must have a digit as last non-space char */
-   if (c == func || !isascii(*c) || !isdigit(*c))
+   if (c == func || !isascii((unsigned char) *c) || !isdigit((unsigned char) *c))
        return -1;
 
    /* find start of digit string */
-   while (c > func && isascii(*c) && isdigit(*c))
+   while (c > func && isascii((unsigned char) *c) && isdigit((unsigned char) *c))
        c--;
 
    /* digits must be separated from func name by space or closing paren */
    /* notice also that we are not allowing an empty func name ... */
-   if (c == func || !isascii(*c) || !(isspace(*c) || *c == ')'))
+   if (c == func || !isascii((unsigned char) *c) ||
+       !(isspace((unsigned char) *c) || *c == ')'))
        return -1;
 
    /* parse digit string */