mirror of
https://github.com/benhoyt/inih.git
synced 2025-02-05 07:08:23 +08:00
Ensure value passed to strcmp is non-NULL in unittest.c
Fixes #127. Thanks Seth Arnold.
This commit is contained in:
parent
cb55f57d87
commit
e492a253ec
@ -42,6 +42,11 @@ int dumper(void* user, const char* section, const char* name,
|
|||||||
printf("... %s%s%s;\n", name, value ? "=" : "", value ? value : "");
|
printf("... %s%s%s;\n", name, value ? "=" : "", value ? value : "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
// Happens when INI_ALLOW_NO_VALUE=1 and line has no value (no '=' or ':')
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return strcmp(name, "user")==0 && strcmp(value, "parse_error")==0 ? 0 : 1;
|
return strcmp(name, "user")==0 && strcmp(value, "parse_error")==0 ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user