]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/country.c
country: Make country codes beginning with X invalid
[people/ms/libloc.git] / src / country.c
index 3ea04cc45c2f32656dc53cca2ab52e2b9299858b..0f133198e4ec50f1adcdf46bf334f511ecc071ec 100644 (file)
@@ -209,6 +209,10 @@ LOC_EXPORT int loc_country_code_is_valid(const char* cc) {
                        return 0;
        }
 
+       // The code cannot begin with an X (those are reserved for private use)
+       if (*cc == 'X')
+               return 0;
+
        // Looks valid
        return 1;
 }