]> granicus.if.org Git - postgresql/commitdiff
I have two small patches which correct some very obscure bug in the parser
authorMarc G. Fournier <scrappy@hub.org>
Thu, 19 Sep 1996 20:05:59 +0000 (20:05 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Thu, 19 Sep 1996 20:05:59 +0000 (20:05 +0000)
of the array constants and in one of the loadable modules I posted some time
ago.

Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>

contrib/string/string_io.c
src/backend/utils/adt/arrayfuncs.c

index ab49c5321a375bbc6248dacc6a54c4b617bc5413..b6158c74e43feda7c541c6e751cbae430bb6675b 100644 (file)
@@ -79,7 +79,7 @@ string_output(char *data, int size)
            len++;
            break;
          default:
-           if (NOTPRINTABLE(c)) {
+           if (NOTPRINTABLE(*p)) {
                len += 3;
            }
        }
index acaeeb067c89f0ae8314b67417882bbaf29aa9dd..f3a7d5c3809dab42b6316a04985418b6e32864fb 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.4 1996/08/27 07:32:27 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.5 1996/09/19 20:04:56 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -235,6 +235,10 @@ _ArrayCount(char *str, int dim[], int typdelim)
                 }
                 break;
 #endif
+           case '\0':
+               /* Signal a premature end of the string.  DZ - 2-9-1996 */
+               elog(WARN, "malformed array constant: %s", str);
+               break;
            case '\"':
                scanning_string = ! scanning_string;
                break;