diff --git a/DPlusAuthenticator.cpp b/DPlusAuthenticator.cpp index 8dea5d2..47b158e 100644 --- a/DPlusAuthenticator.cpp +++ b/DPlusAuthenticator.cpp @@ -124,6 +124,7 @@ bool CDPlusAuthenticator::authenticate(const std::string &callsign, const std::s Trim(address); Trim(name); + name.resize(8, ' '); // Get the active flag bool active = (buffer[i + 25U] & 0x80U) == 0x80U; @@ -141,7 +142,7 @@ bool CDPlusAuthenticator::authenticate(const std::string &callsign, const std::s } printf("Authorized DPlus with %s using callsign %s\n", hostname.c_str(), callsign.c_str()); - printf("Added %ld DPlus gateways\n", gwy_map.size()); + printf("Added %d DPlus gateways\n", (int)gwy_map.size()); socket.close(); delete[] buffer; diff --git a/QnetLink.cpp b/QnetLink.cpp index da8cd5e..45416ad 100644 --- a/QnetLink.cpp +++ b/QnetLink.cpp @@ -402,14 +402,14 @@ bool CQnetLink::load_gwys(const std::string &filename) sprintf(payload, "%s %s", host, port); auto gwy_pos = gwy_list.find(call); - if (gwy_pos == gwy_list.end()) - printf("Added Call=[%s], payload=[%s]\n",call, payload); - else + if (gwy_pos != gwy_list.end()) printf("%s %s has been redefined!\n", call, payload); gwy_list[call] = payload; } fclose(fp); + for (auto it=gwy_list.begin(); it!=gwy_list.end(); it++) + printf("%s %s\n", it->first.c_str(), it->second.c_str()); printf("Added %d gateways\n", (int)gwy_list.size()); return true; }