Content-Length: 274103 | pFad | http://github.com/postgrespro/postgres_cluster/commit/cb0ca0c9953aa0614e7b143bd2440a7582a27233

BF Fix unportable usage of <ctype.h> functions. · postgrespro/postgres_cluster@cb0ca0c · GitHub
Skip to content

Commit cb0ca0c

Browse files
committed
Fix unportable usage of <ctype.h> functions.
isdigit(), isspace(), etc are likely to give surprising results if passed a signed char. We should always cast the argument to unsigned char to avoid that. Error in commit d78a7d9, found by buildfarm member gaur.
1 parent 2b46259 commit cb0ca0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/tsearch/spell.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ DecodeFlag(IspellDict *Conf, char *sflag, char **sflagnext)
363363
errmsg("non-ASCII affix flag \"%s\"",
364364
sflag)));
365365
}
366-
else if (isdigit(*next))
366+
else if (isdigit((unsigned char) *next))
367367
{
368368
if (!met_comma)
369369
ereport(ERROR,
@@ -381,7 +381,7 @@ DecodeFlag(IspellDict *Conf, char *sflag, char **sflagnext)
381381
sflag)));
382382
met_comma = true;
383383
}
384-
else if (!isspace(*next))
384+
else if (!isspace((unsigned char) *next))
385385
{
386386
ereport(ERROR,
387387
(errcode(ERRCODE_CONFIG_FILE_ERROR),

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/cb0ca0c9953aa0614e7b143bd2440a7582a27233

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy