version 1.11, 2003/10/18 19:57:10 |
version 1.12, 2003/10/18 20:35:36 |
|
|
p = realloc(instructions, newsize * sizeof(*p)); |
p = realloc(instructions, newsize * sizeof(*p)); |
if (p == NULL) { |
if (p == NULL) { |
free(instructions); |
free(instructions); |
err(1, "cannot realloc instruction buffer"); |
err(1, NULL); |
} |
} |
instructions = p; |
instructions = p; |
instr_sz = newsize; |
instr_sz = newsize; |
|
|
instructions[current].index = ALLOC_STRING; |
instructions[current].index = ALLOC_STRING; |
instructions[current].u.astr = strdup(str); |
instructions[current].u.astr = strdup(str); |
if (instructions[current].u.astr == NULL) |
if (instructions[current].u.astr == NULL) |
err(1, "cannot allocate string"); |
err(1, NULL); |
return current++; |
return current++; |
} |
} |
|
|
|
|
asprintf(&str, "%s: %s:%d: %s: %s unexpected", |
asprintf(&str, "%s: %s:%d: %s: %s unexpected", |
__progname, filename, lineno, s, yytext); |
__progname, filename, lineno, s, yytext); |
if (str == NULL) |
if (str == NULL) |
err(1, "cannot allocate string"); |
err(1, NULL); |
|
|
fputs("c[", stdout); |
fputs("c[", stdout); |
for (p = str; *p != '\0'; p++) { |
for (p = str; *p != '\0'; p++) { |