diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-09-22 21:39:58 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-09-22 21:39:58 +0000 |
| commit | beca984e5f1c315d02064e69861be112f5a69b3d (patch) | |
| tree | b06b0b54e649824380e3b35822c1c054dac24608 /contrib/hstore | |
| parent | 6d0efd3a092ec60c7e27b53e604cbc87ba3c8e2c (diff) | |
| download | postgresql-beca984e5f1c315d02064e69861be112f5a69b3d.tar.gz | |
Fix bugs in plpgsql and ecpg caused by assuming that isspace() would only
return true for exactly the characters treated as whitespace by their flex
scanners. Per report from Victor Snezhko and subsequent investigation.
Also fix a passel of unsafe usages of <ctype.h> functions, that is, ye olde
char-vs-unsigned-char issue. I won't miss <ctype.h> when we are finally
able to stop using it.
Diffstat (limited to 'contrib/hstore')
| -rw-r--r-- | contrib/hstore/hstore_io.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index b905ff7f3d..051a411a99 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -51,7 +51,7 @@ get_val( HSParser *state, bool ignoreeq, bool *escaped ) { elog(ERROR,"Syntax error near '%c' at postion %d", *(state->ptr), (int4)(state->ptr-state->begin)); } else if ( *(state->ptr) == '\\' ) { st = GV_WAITESCIN; - } else if ( !isspace(*(state->ptr)) ) { + } else if ( !isspace((unsigned char) *(state->ptr)) ) { *(state->cur) = *(state->ptr); state->cur++; st = GV_INVAL; @@ -65,7 +65,7 @@ get_val( HSParser *state, bool ignoreeq, bool *escaped ) { } else if ( *(state->ptr) == ',' && ignoreeq ) { state->ptr--; return true; - } else if ( isspace(*(state->ptr)) ) { + } else if ( isspace((unsigned char) *(state->ptr)) ) { return true; } else if ( *(state->ptr) == '\0' ) { state->ptr--; @@ -146,7 +146,7 @@ parse_hstore( HSParser *state ) { st = WGT; } else if ( *(state->ptr) == '\0' ) { elog(ERROR,"Unexpectd end of string"); - } else if (!isspace(*(state->ptr))) { + } else if (!isspace((unsigned char) *(state->ptr))) { elog(ERROR,"Syntax error near '%c' at postion %d", *(state->ptr), (int4)(state->ptr-state->begin)); } } else if ( st == WGT ) { @@ -177,7 +177,7 @@ parse_hstore( HSParser *state ) { st = WKEY; } else if ( *(state->ptr) == '\0' ) { return; - } else if (!isspace(*(state->ptr))) { + } else if (!isspace((unsigned char) *(state->ptr))) { elog(ERROR,"Syntax error near '%c' at postion %d", *(state->ptr), (int4)(state->ptr-state->begin)); } } else |
