mirror of
https://github.com/benhoyt/inih.git
synced 2025-01-17 22:22:53 +08:00
Avoid cppcheck free() error (#67)
This commit is contained in:
parent
5b0e675a4d
commit
a9f2a5e657
4
ini.c
4
ini.c
@ -87,7 +87,7 @@ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
|
||||
char* line;
|
||||
int max_line = INI_INITIAL_ALLOC;
|
||||
#endif
|
||||
#if INI_ALLOW_REALLOC
|
||||
#if INI_ALLOW_REALLOC && !INI_USE_STACK
|
||||
char* new_line;
|
||||
int offset;
|
||||
#endif
|
||||
@ -116,7 +116,7 @@ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
|
||||
|
||||
/* Scan through stream line by line */
|
||||
while (reader(line, max_line, stream) != NULL) {
|
||||
#if INI_ALLOW_REALLOC
|
||||
#if INI_ALLOW_REALLOC && !INI_USE_STACK
|
||||
offset = strlen(line);
|
||||
while (offset == max_line - 1 && line[offset - 1] != '\n') {
|
||||
max_line *= 2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user