fix filtercountrycode

Co-authored-by: aurhat <[email protected]>
This commit is contained in:
flowtron
2022-04-06 17:52:28 +02:00
co-authored by aurhat
parent a48a6ec5a8
commit 86beba855a
+2 -2
View File
@@ -474,13 +474,13 @@ void filterlang(char *d, const char *s)
void filtercountrycode(char *d, const char *s) // returns exactly two uppercase chars or "--"
{
d[0] = d[1] = '-';
d[2] = '\0';
if(isalpha(s[0]) && isalpha(s[1]) && !s[2])
{
d[0] = toupper(s[0]);
d[1] = toupper(s[1]);
}
else d[0] = d[1] = '-';
d[2] = '\0';
}
void trimtrailingwhitespace(char *s)