1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

"char *" of course is not the same as "char []". So I had to fix the way ecpg treated the second one.

This commit is contained in:
Michael Meskes
2003-07-07 12:15:33 +00:00
parent 841b4a2d55
commit 91d60637cf
3 changed files with 21 additions and 2 deletions

View File

@ -512,7 +512,14 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
/* one index is the string length */
if (atoi(*length) < 0)
{
*length = (atoi(*dimension) < 0) ? make_str("1") : *dimension;
/* make sure we return length = -1 for arrays without given bounds */
if (atoi(*dimension) < 0)
*length = make_str("1");
else if (atoi(*dimension) == 0)
*length = make_str("-1");
else
*length = *dimension;
*dimension = make_str("-1");
}
break;