summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-06-10 11:30:18 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-11 13:58:20 -0700
commit2d7b02726e8501d5e45d3648768a3d2485e70f91 (patch)
treeb65a06c381f71c6275603a68eb3fa0b90624634b
parent2b59765da3882f1564e5ae034a35c0ce35441108 (diff)
downloadsubsurface-2d7b02726e8501d5e45d3648768a3d2485e70f91.tar.gz
Have explicit "%s" format strings in printf style statements
Not having a format string that explicitly references the arguments is considered a potential security issue in code. This gets rid of a compiler warning that turned into an error on Fedora 21. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--planner.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/planner.c b/planner.c
index b682bd5cd..25fd4908b 100644
--- a/planner.c
+++ b/planner.c
@@ -532,12 +532,12 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
translate("gettextFromC", "%s<br>Subsurface dive plan<br>based on GFlow = %d and GFhigh = %d<br><br>"),
show_disclaimer ? disclaimer : empty, diveplan->gflow, diveplan->gfhigh);
if (!plan_verbatim) {
- len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", "<table cellspacing=5%><thead><tr><th>depth</th>"));
+ len += snprintf(buffer + len, sizeof(buffer) - len, "%s", translate("gettextFromC", "<table cellspacing=5%><thead><tr><th>depth</th>"));
if (plan_display_runtime)
- len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", " <th>runtime</th>"));
+ len += snprintf(buffer + len, sizeof(buffer) - len, "%s", translate("gettextFromC", " <th>runtime</th>"));
if (plan_display_duration)
- len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", " <th>duration</th>"));
- len += snprintf(buffer + len, sizeof(buffer) - len, " <th align=left>gas</th></tr><tbody align=right>");
+ len += snprintf(buffer + len, sizeof(buffer) - len, "%s", translate("gettextFromC", " <th>duration</th>"));
+ len += snprintf(buffer + len, sizeof(buffer) - len, "%s", translate("gettextFromC"," <th align=left>gas</th></tr><tbody align=right>"));
}
do {
struct gasmix gasmix, newgasmix;
@@ -619,7 +619,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
lastdepth = dp->depth;
} while ((dp = nextdp) != NULL);
len = strlen(buffer);
- snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", "</tbody></table><br>Gas consumption:<br>"));
+ snprintf(buffer + len, sizeof(buffer) - len, "%s", translate("gettextFromC", "</tbody></table><br>Gas consumption:<br>"));
for (gasidx = 0; gasidx < MAX_CYLINDERS; gasidx++) {
double volume;
const char *unit;