profile: fix string formating in profile.cpp

ae299d5e66 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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-01 08:14:02 +02:00 committed by Michael Keller
parent af6caa6fa2
commit 32a08735c3

View file

@ -1368,8 +1368,8 @@ static std::vector<std::string> plot_string(const struct dive *d, const struct p
std::vector<std::string> 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)