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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy