mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Improved an internal allocation
Improved the way that the internal array, consttable, is allocated.
This commit is contained in:
2
const.c
2
const.c
@@ -44,7 +44,7 @@ initconstants(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
consttable = (NUMBER **) malloc(sizeof(NUMBER *) * CONSTALLOCSIZE);
|
consttable = (NUMBER **) calloc(sizeof(NUMBER *), CONSTALLOCSIZE);
|
||||||
if (consttable == NULL) {
|
if (consttable == NULL) {
|
||||||
math_error("Unable to allocate constant table");
|
math_error("Unable to allocate constant table");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
|
Reference in New Issue
Block a user