aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-11-07 13:49:36 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-11-07 13:49:36 -0500
commitd1f9ac5b100dbc4da02f0f209a2e7730bd5e83e9 (patch)
treeccdb7eef33cee7b5c2a1d71d02df2c617c907eb4 /src
parent4b0d28de06b28e57c540fca458e4853854fbeaf8 (diff)
downloadpostgresql-d1f9ac5b100dbc4da02f0f209a2e7730bd5e83e9.tar.gz
postgresql-d1f9ac5b100dbc4da02f0f209a2e7730bd5e83e9.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 63d6b97fd, found by buildfarm member gaur. Back-patch to 9.3, like that commit.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index 82229ecfbf4..8f901a83fb2 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -57,7 +57,7 @@ garbage_left(enum ARRAY_TYPE isarray, char **scan_length, enum COMPAT_MODE compa
/* skip invalid characters */
do {
(*scan_length)++;
- } while (isdigit(**scan_length));
+ } while (isdigit((unsigned char) **scan_length));
}
if (**scan_length != ' ' && **scan_length != '\0')