Commit d7c9d57b authored by Michael Tremer's avatar Michael Tremer

country: Fix segmentation fault when continent code is not set

Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 5adcc584
......@@ -159,9 +159,11 @@ int loc_country_to_database_v0(struct loc_country* country,
}
// Add continent code
if (country->continent_code) {
for (unsigned int i = 0; i < 2; i++) {
dbobj->continent_code[i] = country->continent_code[i] ? country->continent_code[i] : '\0';
}
}
// Save the name string in the string pool
off_t name = loc_stringpool_add(pool, country->name ? country->name : "");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment