aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2012-11-23 14:39:27 +0100
committerMichael Meskes <meskes@postgresql.org>2012-11-23 14:39:27 +0100
commitc50b8a4637bcaab2f0e1fb69c39fdcec7e535874 (patch)
treefecca8956145f7ca5cb737ee2bbdf9bc16de55ca
parent455b8887cf79dc4d4b5fea0cf65f56f316baaaa2 (diff)
downloadpostgresql-c50b8a4637bcaab2f0e1fb69c39fdcec7e535874.tar.gz
postgresql-c50b8a4637bcaab2f0e1fb69c39fdcec7e535874.zip
Applied patch by Chen Huajun <chenhj@cn.fujitsu.com> to make ecpg able to cope
with very long structs.
-rw-r--r--src/interfaces/ecpg/preproc/type.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index c743616a6ca..cf2ff158413 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -506,8 +506,8 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
*/
struct ECPGstruct_member *p,
*ind_p = NULL;
- char pbuf[BUFSIZ],
- ind_pbuf[BUFSIZ];
+ char *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
+ char *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
if (atoi(arrsiz) == 1)
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);
@@ -540,6 +540,9 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
if (ind_p != NULL && ind_p != &struct_no_indicator)
ind_p = ind_p->next;
}
+
+ free(pbuf);
+ free(ind_pbuf);
}
void