]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/country.c
country: Terminate buffer when reading from database
[people/ms/libloc.git] / src / country.c
index d6ddf508636fb5d69a080c8814a9530133465358..2ba93e6ef7d5c225d032b8b307ad76942659b0e0 100644 (file)
@@ -125,6 +125,9 @@ int loc_country_new_from_database_v1(struct loc_ctx* ctx, struct loc_stringpool*
        // Read country code
        loc_country_code_copy(buffer, dbobj->code);
 
+       // Terminate buffer
+       buffer[2] = '\0';
+
        // Create a new country object
        int r = loc_country_new(ctx, country, buffer);
        if (r)