From 32a08735c3b5bff4c8cf74bd7bc81662b8fd7bdb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 1 May 2024 08:14:02 +0200 Subject: [PATCH] profile: fix string formating in profile.cpp ae299d5e663cd672d1114c3fe90cf026b9ab463e introduced a format- string bug by splitting a format-string in two and splitting the arguments at the wrong place. The compiler doesn't warn in this case, because the format- string is passed through translate(...). This should have crashed, but for some reason didn't, at least on Linux. Fix the arguments. Signed-off-by: Berthold Stoeger --- core/profile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/profile.cpp b/core/profile.cpp index c16793d4b..36bbc842d 100644 --- a/core/profile.cpp +++ b/core/profile.cpp @@ -1368,8 +1368,8 @@ static std::vector plot_string(const struct dive *d, const struct p std::vector res; depthvalue = get_depth_units(entry->depth, NULL, &depth_unit); - res.push_back(casprintf_loc(translate("gettextFromC", "@: %d:%02d"), FRACTION(entry->sec, 60), depthvalue)); - res.push_back(casprintf_loc(translate("gettextFromC", "D: %.1f%s"), depth_unit)); + res.push_back(casprintf_loc(translate("gettextFromC", "@: %d:%02d"), FRACTION(entry->sec, 60))); + res.push_back(casprintf_loc(translate("gettextFromC", "D: %.1f%s"), depthvalue, depth_unit)); for (cyl = 0; cyl < pi->nr_cylinders; cyl++) { int mbar = get_plot_pressure(pi, idx, cyl); if (!mbar)