diff --git a/source/src/protocol.cpp b/source/src/protocol.cpp index 73f1db59..8957c5fb 100644 --- a/source/src/protocol.cpp +++ b/source/src/protocol.cpp @@ -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)