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