mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.11.0t4
This commit is contained in:
12
string.c
12
string.c
@@ -960,8 +960,8 @@ stringrsearch(STRING *s1, STRING *s2, long start, long end, ZVALUE *index)
|
||||
#define STRALLOC 100
|
||||
|
||||
|
||||
static STRING *freeStr;
|
||||
static STRING **firstStrs;
|
||||
static STRING *freeStr = NULL;
|
||||
static STRING **firstStrs = NULL;
|
||||
static long blockcount = 0;
|
||||
|
||||
|
||||
@@ -984,8 +984,12 @@ stralloc(void)
|
||||
temp->s_links = 0;
|
||||
}
|
||||
blockcount++;
|
||||
newfn = (STRING **)
|
||||
realloc(firstStrs, blockcount * sizeof(STRING *));
|
||||
if (firstStrs == NULL) {
|
||||
newfn = (STRING **) malloc( blockcount * sizeof(STRING *));
|
||||
} else {
|
||||
newfn = (STRING **)
|
||||
realloc(firstStrs, blockcount * sizeof(STRING *));
|
||||
}
|
||||
if (newfn == NULL) {
|
||||
math_error("Cannot allocate new string block");
|
||||
/*NOTREACHED*/
|
||||
|
Reference in New Issue
Block a user