From d576b4c6e9c44bcb29ff2f313bc72242c14323a7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 15 Oct 2021 15:32:11 +0100 Subject: [PATCH] Adapt to revised SGMetar API API is changed to use strings instead of raw pointers. --- src/Environment/fgmetar.cxx | 2 +- src/Main/metar_main.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Environment/fgmetar.cxx b/src/Environment/fgmetar.cxx index d0f6ead35..36cecf8ba 100644 --- a/src/Environment/fgmetar.cxx +++ b/src/Environment/fgmetar.cxx @@ -151,7 +151,7 @@ FGMetar::FGMetar(const string& icao) : _time = sgTimeGetGMT(_year - 1900, _month - 1, _day, _hour, _minute, 0); - SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "FGMetar:" << getRawDataPtr()); + SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "FGMetar:" << getDataString()); if (_x_proxy) SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "METAR from proxy"); else diff --git a/src/Main/metar_main.cxx b/src/Main/metar_main.cxx index e76676225..d985517bc 100644 --- a/src/Main/metar_main.cxx +++ b/src/Main/metar_main.cxx @@ -385,10 +385,10 @@ int main(int argc, char *argv[]) //SGMetar *m = new SGMetar("2004/01/11 01:20\nLOWG 110120Z AUTO VRB01KT 0050 1600N R35/0600 FG M06/M06 Q1019 88//////\n"); if (verbose) { - cerr << G "INPUT: " << m->getData() << "" N << endl; + cerr << G "INPUT: " << m->getDataString() << "" N << endl; - const char *unused = m->getUnusedData(); - if (*unused) + const auto unused = m->getUnparsedData(); + if (!unused.empty()) cerr << R "UNUSED: " << unused << "" N << endl; }