diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-08-06 15:54:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-08-06 15:54:06 +0000 |
commit | a6672880e177fbc4dd3250ee024b610f5f2f2d8e (patch) | |
tree | faeed1af1d31dd3ceb0eb19637ea590cdec7e548 /src | |
parent | 87531577391f769963fab657c6698d3b79dd87d0 (diff) | |
download | postgresql-a6672880e177fbc4dd3250ee024b610f5f2f2d8e.tar.gz postgresql-a6672880e177fbc4dd3250ee024b610f5f2f2d8e.zip |
Fix compiler-detected problem for Alphas: it seems strlen returns
something wider than int on that platform. Also, remove bogus
assumption that sizeof("INT_MAX") has something to do with the maximum
number of digits in an int.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 5aab750345b..14f51f8460d 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.250 2003/08/01 11:25:55 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.251 2003/08/06 15:54:06 tgl Exp $ */ /* Copyright comment */ %{ @@ -5290,9 +5290,9 @@ UsingConst: AllConst { if ($1[1] != '?') /* found a constant */ { - char *length = mm_alloc(sizeof("INT_MAX")+1); + char *length = mm_alloc(32); - sprintf(length, "%d", strlen($1)); + sprintf(length, "%d", (int) strlen($1)); add_variable(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator); } } |