]> git.mxchange.org Git - flightgear.git/commitdiff
gcc issues 'format not a string literal and no format arguments' when running -Werror...
authorErik Hofman <erik@ehofman.com>
Sat, 26 Jun 2010 07:36:48 +0000 (09:36 +0200)
committerErik Hofman <erik@ehofman.com>
Sat, 26 Jun 2010 07:36:48 +0000 (09:36 +0200)
src/Cockpit/hud_labl.cxx
src/Instrumentation/HUD/HUD_label.cxx

index 95d69142a5104e9d7ee76840596edeac82130290..8927b113e60e6f3f60b7285e455565b0de73c308 100644 (file)
@@ -114,7 +114,7 @@ void instr_label::draw(void)
         }
 
     } else {
-        snprintf(label_buffer, sizeof( label_buffer) -1, format_buffer.c_str());
+        snprintf(label_buffer, sizeof( label_buffer)-1, format_buffer.c_str(), 0);
     }
 
     lenstr = getStringWidth(label_buffer);
index 98a6a1df0974612cd95815a9f47e8af1c6e3be3a..5cf2bcb57f0498809e2b525b7cf5ccbdc149a471 100644 (file)
@@ -144,7 +144,7 @@ void HUD::Label::draw(void)
     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)