mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Avoid passing signed chars to <ctype.h> functions ... same old
portability mistake as always. Per buildfarm member pika.
This commit is contained in:
parent
f121c408e2
commit
1dab218a69
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user