]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/country.c
Implement filtering for multiple countries in the enumerator
[people/ms/libloc.git] / src / country.c
index 2ba93e6ef7d5c225d032b8b307ad76942659b0e0..7aac0dba3ae50acffffb52284cdcfeb7fc73fe92 100644 (file)
@@ -34,6 +34,9 @@ struct loc_country {
 };
 
 LOC_EXPORT int loc_country_new(struct loc_ctx* ctx, struct loc_country** country, const char* country_code) {
+       if (!loc_country_code_is_valid(country_code))
+               return -EINVAL;
+
        struct loc_country* c = calloc(1, sizeof(*c));
        if (!c)
                return -ENOMEM;