Commit 1dab218a authored by Tom Lane's avatar Tom Lane

Avoid passing signed chars to <ctype.h> functions ... same old

portability mistake as always.  Per buildfarm member pika.
parent f121c408
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment