]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_label.cxx
Merge branch 'torsten/proplist' into next
[flightgear.git] / src / Instrumentation / HUD / HUD_label.cxx
index 16a2348738d00ac9b708650e886bb8d64c7d7f30..98a6a1df0974612cd95815a9f47e8af1c6e3be3a 100644 (file)
@@ -23,7 +23,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/props/condition.hxx>
 #include "HUD.hxx"
 
 
@@ -69,7 +68,8 @@ HUD::Label::Label(HUD *hud, const SGPropertyNode *n, float x, float y) :
 
     _mode = check_format(_format.c_str());
     if (_mode == INVALID) {
-        SG_LOG(SG_INPUT, SG_ALERT, "HUD: invalid format '" << _format.c_str() << '\'');
+        SG_LOG(SG_INPUT, SG_ALERT, "HUD: invalid format '" << _format.c_str()
+                << "' in <label> '" << _name << '\'');
         _format = "INVALID";
         _mode = NONE;
     }
@@ -80,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) {
@@ -141,7 +141,8 @@ 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());
     else if (_mode == STRING)