From de3afcce99c86531d29a90bdf692c721989b8c36 Mon Sep 17 00:00:00 2001 From: Erik Hofman <erik@ehofman.com> Date: Sat, 26 Jun 2010 09:36:48 +0200 Subject: [PATCH] gcc issues 'format not a string literal and no format arguments' when running -Werror, trick gcc into thinking everything is alright. --- src/Cockpit/hud_labl.cxx | 2 +- src/Instrumentation/HUD/HUD_label.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cockpit/hud_labl.cxx b/src/Cockpit/hud_labl.cxx index 95d69142a..8927b113e 100644 --- a/src/Cockpit/hud_labl.cxx +++ b/src/Cockpit/hud_labl.cxx @@ -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); diff --git a/src/Instrumentation/HUD/HUD_label.cxx b/src/Instrumentation/HUD/HUD_label.cxx index 98a6a1df0..5cf2bcb57 100644 --- a/src/Instrumentation/HUD/HUD_label.cxx +++ b/src/Instrumentation/HUD/HUD_label.cxx @@ -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)