Applied patch by Chen Huajun <chenhj@cn.fujitsu.com> to make ecpg able to cope

with very long structs.
This commit is contained in:
Michael Meskes 2012-11-23 14:39:27 +01:00
parent 455b8887cf
commit c50b8a4637

View File

@ -506,8 +506,8 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
*/ */
struct ECPGstruct_member *p, struct ECPGstruct_member *p,
*ind_p = NULL; *ind_p = NULL;
char pbuf[BUFSIZ], char *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
ind_pbuf[BUFSIZ]; char *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
if (atoi(arrsiz) == 1) if (atoi(arrsiz) == 1)
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name); 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) if (ind_p != NULL && ind_p != &struct_no_indicator)
ind_p = ind_p->next; ind_p = ind_p->next;
} }
free(pbuf);
free(ind_pbuf);
} }
void void