aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-03-06 18:23:53 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-03-06 18:23:53 -0500
commitcb0ca0c9953aa0614e7b143bd2440a7582a27233 (patch)
treed773dc17e8c9222f6ebbe6f5f90fe08e66fbc75b
parent2b46259b46b3d34e6858afbf3d28c30cef12652b (diff)
downloadpostgresql-cb0ca0c9953aa0614e7b143bd2440a7582a27233.tar.gz
postgresql-cb0ca0c9953aa0614e7b143bd2440a7582a27233.zip
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 d78a7d9c7fa3e9cd, found by buildfarm member gaur.
-rw-r--r--src/backend/tsearch/spell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c
index be3432693df..7c24c474957 100644
--- a/src/backend/tsearch/spell.c
+++ b/src/backend/tsearch/spell.c
@@ -363,7 +363,7 @@ DecodeFlag(IspellDict *Conf, char *sflag, char **sflagnext)
errmsg("non-ASCII affix flag \"%s\"",
sflag)));
}
- else if (isdigit(*next))
+ else if (isdigit((unsigned char) *next))
{
if (!met_comma)
ereport(ERROR,
@@ -381,7 +381,7 @@ DecodeFlag(IspellDict *Conf, char *sflag, char **sflagnext)
sflag)));
met_comma = true;
}
- else if (!isspace(*next))
+ else if (!isspace((unsigned char) *next))
{
ereport(ERROR,
(errcode(ERRCODE_CONFIG_FILE_ERROR),