Convert the callsign to upper case.

This commit is contained in:
Jonathan Naylor
2016-04-19 17:25:13 +01:00
parent 2b76af2e7b
commit ae2ae9d188

View File

@@ -173,9 +173,12 @@ bool CConf::read()
char* value = ::strtok(NULL, "\r\n"); char* value = ::strtok(NULL, "\r\n");
if (section == SECTION_GENERAL) { 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; m_callsign = value;
else if (::strcmp(key, "Timeout") == 0) } else if (::strcmp(key, "Timeout") == 0)
m_timeout = (unsigned int)::atoi(value); m_timeout = (unsigned int)::atoi(value);
else if (::strcmp(key, "Duplex") == 0) else if (::strcmp(key, "Duplex") == 0)
m_duplex = ::atoi(value) == 1; m_duplex = ::atoi(value) == 1;
@@ -243,7 +246,7 @@ bool CConf::read()
char* p = ::strtok(value, ",\r\n"); char* p = ::strtok(value, ",\r\n");
while (p != NULL) { while (p != NULL) {
if (::strlen(p) > 0U) { 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]); p[i] = ::toupper(p[i]);
std::string callsign = std::string(p); std::string callsign = std::string(p);
callsign.resize(DSTAR_LONG_CALLSIGN_LENGTH, ' '); callsign.resize(DSTAR_LONG_CALLSIGN_LENGTH, ' ');