mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Change initnumbs[] to be NULL terminated
This commit is contained in:
8
const.c
8
const.c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user