diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-09-02 06:11:43 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-09-02 06:11:43 +0000 |
| commit | a12b4e279bc12a7cd7b7d679fcac4689ac4aba7b (patch) | |
| tree | ff120ff0c156829d771bdc874fe8fbb2aa4fbf6e /contrib/cube/cubeparse.y | |
| parent | 48e1a39924d9e0674306156a6519cf5688c67c43 (diff) | |
| download | postgresql-a12b4e279bc12a7cd7b7d679fcac4689ac4aba7b.tar.gz | |
I checked all the previous string handling errors and most of them were
already fixed by You. However there were a few left and attached patch
should fix the rest of them.
I used StringInfo only in 2 places and both of them are inside debug
ifdefs. Only performance penalty will come from using strlen() like all
the other code does.
I also modified some of the already patched parts by changing
snprintf(buf, 2 * BUFSIZE, ... style lines to
snprintf(buf, sizeof(buf), ... where buf is an array.
Jukka Holappa
Diffstat (limited to 'contrib/cube/cubeparse.y')
| -rw-r--r-- | contrib/cube/cubeparse.y | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/cube/cubeparse.y b/contrib/cube/cubeparse.y index accad12511..887528eb03 100644 --- a/contrib/cube/cubeparse.y +++ b/contrib/cube/cubeparse.y @@ -164,8 +164,9 @@ int cube_yyerror ( char *msg ) { position = parse_buffer_pos() > parse_buffer_size() ? parse_buffer_pos() - 1 : parse_buffer_pos(); - sprintf( + snprintf( buf, + 256, "%s at or before position %d, character ('%c', \\%03o), input: '%s'\n", msg, position, |
