From a00e9e571d86d26f37129c7a27e321c4dc62c385 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 14 Jun 2020 18:15:50 +0100 Subject: [PATCH] src/Airports/: fixed some minor warnings and use snprintf. --- src/Airports/groundnetwork.hxx | 2 +- src/Airports/runways.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Airports/groundnetwork.hxx b/src/Airports/groundnetwork.hxx index c9dd19d5e..0984247ef 100644 --- a/src/Airports/groundnetwork.hxx +++ b/src/Airports/groundnetwork.hxx @@ -47,7 +47,7 @@ public: ~Block() {}; int getId() { return id; }; void updateTimeStamps(time_t bt, time_t now) { blocktime = (bt < blocktime) ? bt : blocktime; touch = now; }; - const time_t getBlockTime() const { return blocktime; }; + time_t getBlockTime() const { return blocktime; }; time_t getTimeStamp() { return touch; }; bool operator< (const Block &other) const { return blocktime < other.blocktime; }; }; diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 9f2291f7b..f36dc7769 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -78,7 +78,7 @@ string FGRunway::reverseIdent(const string& aRunwayIdent) rn -= 36; } - sprintf(buf, "%02i", rn); + snprintf(buf, sizeof(buf), "%02i", rn); if(ident.size() == 3) { char suffix = toupper(ident[2]); if(suffix == 'L') {