aboutsummaryrefslogtreecommitdiff
path: root/maketab.c
diff options
context:
space:
mode:
Diffstat (limited to 'maketab.c')
-rw-r--r--maketab.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/maketab.c b/maketab.c
index c3ce5c6..9ac833e 100644
--- a/maketab.c
+++ b/maketab.c
@@ -122,8 +122,6 @@ int main(int argc, char *argv[])
printf("#include <stdio.h>\n");
printf("#include \"awk.h\"\n");
printf("#include \"ytab.h\"\n\n");
- for (i = SIZE; --i >= 0; )
- names[i] = "";
if (argc != 2) {
fprintf(stderr, "usage: maketab YTAB_H\n");
@@ -160,10 +158,8 @@ int main(int argc, char *argv[])
table[p->token-FIRSTTOKEN] = p->name;
printf("\nCell *(*proctab[%d])(Node **, int) = {\n", SIZE);
for (i=0; i<SIZE; i++)
- if (table[i]==NULL)
- printf("\tnullproc,\t/* %s */\n", names[i]);
- else
- printf("\t%s,\t/* %s */\n", table[i], names[i]);
+ printf("\t%s,\t/* %s */\n",
+ table[i] ? table[i] : "nullproc", names[i] ? names[i] : "");
printf("};\n\n");
printf("const char *tokname(int n)\n"); /* print a tokname() function */