mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.11.0t9.4.4
This commit is contained in:
15
qmath.c
15
qmath.c
@@ -1382,10 +1382,23 @@ qalloc(void)
|
||||
}
|
||||
freeNum[NNALLOC - 1].next = NULL;
|
||||
freeNum[NNALLOC - 1].links = 0;
|
||||
for (temp = freeNum + NNALLOC - 2; temp >= freeNum; --temp) {
|
||||
|
||||
/*
|
||||
* We prevent the temp pointer from walking behind freeNum
|
||||
* by stopping one short of the end and running the loop one
|
||||
* more time.
|
||||
*
|
||||
* We would stop the loop with just temp >= freeNum, but
|
||||
* doing this helps make code checkers such as insure happy.
|
||||
*/
|
||||
for (temp = freeNum + NNALLOC - 2; temp > freeNum; --temp) {
|
||||
temp->next = temp + 1;
|
||||
temp->links = 0;
|
||||
}
|
||||
/* run the loop manually one last time */
|
||||
temp->next = temp + 1;
|
||||
temp->links = 0;
|
||||
|
||||
blockcount++;
|
||||
if (firstNums == NULL) {
|
||||
newfn = (NUMBER **) malloc(blockcount * sizeof(NUMBER *));
|
||||
|
Reference in New Issue
Block a user