From: j8takagi Date: Sat, 19 Mar 2011 13:32:27 +0000 (+0900) Subject: ソースの修正 X-Git-Tag: v0.1p26~1 X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=commitdiff_plain;h=a9c0bfff368938e5f162835115daff1de1787a01;ds=sidebyside ソースの修正 --- diff --git a/src/label.c b/src/label.c index 04a757d..69a37dc 100644 --- a/src/label.c +++ b/src/label.c @@ -122,18 +122,19 @@ void printlabel() { int i, s = 0; LABELTAB *p; - LABELARRAY *l[labelcnt]; + LABELARRAY **l; + l = calloc_chk(labelcnt, sizeof(LABELARRAY **), "labels"); for(i = 0; i < LABELTABSIZE; i++) { for(p = labels[i]; p != NULL; p = p->next) { assert(p->label != NULL); - l[s] = malloc_chk(sizeof(LABELARRAY), "l[]"); + l[s] = malloc_chk(sizeof(LABELARRAY), "lables"); if(p->prog == NULL) { l[s]->prog = NULL; } else { - l[s]->prog = strdup_chk(p->prog, "l[].prog"); + l[s]->prog = strdup_chk(p->prog, "labels.prog"); } - l[s]->label = strdup_chk(p->label, "l[].label"); + l[s]->label = strdup_chk(p->label, "labels.label"); l[s++]->adr = p->adr; } }