-/* $OpenBSD: lr0.c,v 1.14 2014/01/08 22:30:32 millert Exp $ */
+/* $OpenBSD: lr0.c,v 1.15 2014/01/08 22:36:37 millert Exp $ */
/* $NetBSD: lr0.c,v 1.4 1996/03/19 03:21:35 jtc Exp $ */
/*
int empty;
int done;
- nullable = malloc(nsyms);
+ nullable = calloc(1, nsyms);
if (nullable == 0) no_space();
- memset(nullable, 0, nsyms);
-
done = 0;
while (!done)
{
-/* $OpenBSD: output.c,v 1.17 2014/01/08 21:40:25 millert Exp $ */
+/* $OpenBSD: output.c,v 1.18 2014/01/08 22:36:37 millert Exp $ */
/* $NetBSD: output.c,v 1.4 1996/03/19 03:21:41 jtc Exp $ */
/*
++outline;
fprintf(code_file, "#define YYMAXTOKEN %d\n", max);
- symnam = (char **) malloc((max+1)*sizeof(char *));
+ symnam = (char **) calloc(max+1, sizeof(char *));
if (symnam == 0) no_space();
- /* Note that it is not necessary to initialize the element */
- /* symnam[max]. */
- memset(symnam, 0, max * sizeof(char *));
for (i = ntokens - 1; i >= 2; --i)
symnam[symbol_value[i]] = symbol_name[i];
symnam[0] = "end-of-file";