From: Bruce Momjian Date: Fri, 14 Oct 2005 01:50:58 +0000 (+0000) Subject: [ Backpatch to 7.4.X.] X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=c2c84a2f9a8b0a630d2d815e383e39b5416d5096;p=users%2Fbernd%2Fpostgres.git [ Backpatch to 7.4.X.] Also I fixed a bug in a bug fix I committed a few weeks ago. he check for a varchar pointer was incomplete. Michael Meskes --- diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 7d9e072137..b1767d4e16 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -5121,8 +5121,8 @@ variable: opt_pointer ECPGColLabelCommon opt_array_bounds opt_initializer *dim = '\0'; else sprintf(dim, "[%s]", dimension); - /* if (strcmp(length, "0") == 0)*/ - if (atoi(length) <= 0) + /* cannot check for atoi <= 0 because a defined constant will yield 0 here as well */ + if (atoi(length) < 0 || strcmp(length, "0") == 0) mmerror(PARSE_ERROR, ET_ERROR, "pointer to varchar are not implemented"); if (strcmp(dimension, "0") == 0)