Change initnumbs[] to be NULL terminated

This commit is contained in:
Landon Curt Noll
2021-09-28 22:32:06 -07:00
parent 459c07b121
commit 9e92d4a35a
3 changed files with 9 additions and 9 deletions

View File

@@ -49,11 +49,11 @@ initconstants(void)
math_error("Unable to allocate constant table");
/*NOTREACHED*/
}
for (i = 0; i < INITCONSTCOUNT; i++)
for (i = 0; consttable[i] != NULL; i++) {
consttable[i] = initnumbs[i];
consttable[INITCONSTCOUNT] = NULL; /* firewall */
constcount = INITCONSTCOUNT;
constavail = CONSTALLOCSIZE - INITCONSTCOUNT;
}
constcount = i-1;
constavail = CONSTALLOCSIZE - constcount;
}