aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/parse.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-03 20:45:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-03 20:45:40 +0000
commita27b691e2903a886be640db801677f6f988d3793 (patch)
treec68f25c9edef18954e9c5b3d74893f1df87b8871 /src/interfaces/odbc/parse.c
parent4d2a506526ceacab5f75df040596a5287ab40612 (diff)
downloadpostgresql-a27b691e2903a886be640db801677f6f988d3793.tar.gz
postgresql-a27b691e2903a886be640db801677f6f988d3793.zip
Ensure that all uses of <ctype.h> functions are applied to unsigned-char
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
Diffstat (limited to 'src/interfaces/odbc/parse.c')
-rw-r--r--src/interfaces/odbc/parse.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/interfaces/odbc/parse.c b/src/interfaces/odbc/parse.c
index dac931a6c3a..690a902ec4b 100644
--- a/src/interfaces/odbc/parse.c
+++ b/src/interfaces/odbc/parse.c
@@ -55,7 +55,7 @@ char qc, in_escape = FALSE;
smax--;
/* skip leading delimiters */
- while (isspace(s[i]) || s[i] == ',') {
+ while (isspace((unsigned char) s[i]) || s[i] == ',') {
/* mylog("skipping '%c'\n", s[i]); */
i++;
}
@@ -70,7 +70,8 @@ char qc, in_escape = FALSE;
if (numeric) *numeric = FALSE;
/* get the next token */
- while ( ! isspace(s[i]) && s[i] != ',' && s[i] != '\0' && out != smax) {
+ while ( ! isspace((unsigned char) s[i]) && s[i] != ',' &&
+ s[i] != '\0' && out != smax) {
/* Handle quoted stuff */
if ( out == 0 && (s[i] == '\"' || s[i] == '\'')) {
@@ -102,16 +103,16 @@ char qc, in_escape = FALSE;
}
/* Check for numeric literals */
- if ( out == 0 && isdigit(s[i])) {
+ if ( out == 0 && isdigit((unsigned char) s[i])) {
if (numeric) *numeric = TRUE;
token[out++] = s[i++];
- while ( isalnum(s[i]) || s[i] == '.')
+ while ( isalnum((unsigned char) s[i]) || s[i] == '.')
token[out++] = s[i++];
break;
}
- if ( ispunct(s[i]) && s[i] != '_') {
+ if ( ispunct((unsigned char) s[i]) && s[i] != '_') {
mylog("got ispunct: s[%d] = '%c'\n", i, s[i]);
if (out == 0) {
@@ -133,7 +134,7 @@ char qc, in_escape = FALSE;
token[out] = '\0';
/* find the delimiter */
- while ( isspace(s[i]))
+ while ( isspace((unsigned char) s[i]))
i++;
/* return the most priority delimiter */
@@ -148,7 +149,7 @@ char qc, in_escape = FALSE;
}
/* skip trailing blanks */
- while ( isspace(s[i])) {
+ while ( isspace((unsigned char) s[i])) {
i++;
}