]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_label.cxx
Merge branch 'next' of D:\Git_New\flightgear into next
[flightgear.git] / src / Instrumentation / HUD / HUD_label.cxx
index eb7d979f20402aa2f721aad8fb3399e879f076b7..5cf2bcb57f0498809e2b525b7cf5ccbdc149a471 100644 (file)
@@ -23,7 +23,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/props/condition.hxx>
 #include "HUD.hxx"
 
 
@@ -81,7 +80,7 @@ HUD::Label::Label(HUD *hud, const SGPropertyNode *n, float x, float y) :
 
 void HUD::Label::draw(void)
 {
-    if (!(_mode == NONE || _input.isValid() && blink()))
+    if (!(_mode == NONE || (_input.isValid() && blink())))
         return;
 
     if (_box) {
@@ -142,9 +141,10 @@ void HUD::Label::draw(void)
     }
 
     const int BUFSIZE = 256;
-    char buf[BUFSIZE];
+    char buf[BUFSIZE+1];
+       buf[ BUFSIZE] = '\0';  // Be sure to terminate properly
     if (_mode == NONE)
-        snprintf(buf, BUFSIZE, _format.c_str());
+        snprintf(buf, BUFSIZE, _format.c_str(), 0);
     else if (_mode == STRING)
         snprintf(buf, BUFSIZE, _format.c_str(), _input.getStringValue());
     else if (_mode == INT)