Skip to content

Commit c50b8a4

Browse files
author
Michael Meskes
committed
Applied patch by Chen Huajun <chenhj@cn.fujitsu.com> to make ecpg able to cope
with very long structs.
1 parent 455b888 commit c50b8a4

File tree

1 file changed

+5
-2
lines changed
  • src/interfaces/ecpg/preproc

1 file changed

+5
-2
lines changed

src/interfaces/ecpg/preproc/type.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
506506
*/
507507
struct ECPGstruct_member *p,
508508
*ind_p = NULL;
509-
char pbuf[BUFSIZ],
510-
ind_pbuf[BUFSIZ];
509+
char *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
510+
char *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
511511

512512
if (atoi(arrsiz) == 1)
513513
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,
540540
if (ind_p != NULL && ind_p != &struct_no_indicator)
541541
ind_p = ind_p->next;
542542
}
543+
544+
free(pbuf);
545+
free(ind_pbuf);
543546
}
544547

545548
void

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