diff --git a/src/ini.c b/src/ini.c index 12d0493..2edf437 100644 --- a/src/ini.c +++ b/src/ini.c @@ -68,8 +68,10 @@ static int _write_ini_file(FILE* file, const ini_datum* schema, if (ini_string == schema->type) { const char* str = *(char**)ptr; - if (!needs_quotes(str)) fputs(str, file); - else fprintf(file, "\"%s\"", str); + if (NULL != str) { + if (!needs_quotes(str)) fputs(str, file); + else fprintf(file, "\"%s\"", str); + } } else if (ini_integer == schema->type) { fprintf(file, "%d", *(uint32_t*)ptr);