From 86beba855ac39eeb791a7c7488670b3f80fb800e Mon Sep 17 00:00:00 2001 From: flowtron Date: Wed, 6 Apr 2022 17:52:28 +0200 Subject: [PATCH] fix filtercountrycode Co-authored-by: aurhat <6187373+aurhat@users.noreply.github.com> --- source/src/protocol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)