Skip to content

Commit a667288

Browse files
committed
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.
1 parent 8753157 commit a667288

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.250 2003/08/01 11:25:55 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.251 2003/08/06 15:54:06 tgl Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -5290,9 +5290,9 @@ UsingConst: AllConst
52905290
{
52915291
if ($1[1] != '?') /* found a constant */
52925292
{
5293-
char *length = mm_alloc(sizeof("INT_MAX")+1);
5293+
char *length = mm_alloc(32);
52945294

5295-
sprintf(length, "%d", strlen($1));
5295+
sprintf(length, "%d", (int) strlen($1));
52965296
add_variable(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator);
52975297
}
52985298
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy