From ae2ae9d18801583f50f1f302612859fbf5aea708 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 19 Apr 2016 17:25:13 +0100 Subject: [PATCH] Convert the callsign to upper case. --- Conf.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index 66d714c..2e23a07 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -173,9 +173,12 @@ bool CConf::read() char* value = ::strtok(NULL, "\r\n"); if (section == SECTION_GENERAL) { - if (::strcmp(key, "Callsign") == 0) + if (::strcmp(key, "Callsign") == 0) { + // Convert the callsign to upper case + for (unsigned int i = 0U; value[i] != 0; i++) + value[i] = ::toupper(value[i]); m_callsign = value; - else if (::strcmp(key, "Timeout") == 0) + } else if (::strcmp(key, "Timeout") == 0) m_timeout = (unsigned int)::atoi(value); else if (::strcmp(key, "Duplex") == 0) m_duplex = ::atoi(value) == 1; @@ -243,7 +246,7 @@ bool CConf::read() char* p = ::strtok(value, ",\r\n"); while (p != NULL) { if (::strlen(p) > 0U) { - for (unsigned int i = 0U; p[i] != 0U; i++) + for (unsigned int i = 0U; p[i] != 0; i++) p[i] = ::toupper(p[i]); std::string callsign = std::string(p); callsign.resize(DSTAR_LONG_CALLSIGN_LENGTH, ' ');