aboutsummaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-03 08:44:51 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-03 08:44:51 +1100
commit3e426283b48a2e6e51facd84a92680718420de58 (patch)
tree175157c9754b89b279467b5d3635db47ec37d3cd /planner.c
parent8edb28b69f3dc2aac4492345e57116eb10f1319c (diff)
downloadsubsurface-3e426283b48a2e6e51facd84a92680718420de58.tar.gz
Increase the buffer for the gas text in planner
Translations that use UTF-8 could easily create more characters than I had initially specified. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/planner.c b/planner.c
index 10a1657c3..8ea10be37 100644
--- a/planner.c
+++ b/planner.c
@@ -471,7 +471,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive)
he = dive->cylinder[0].gasmix.he.permille;
do {
const char *depth_unit;
- char gas[12];
+ char gas[64];
double depthvalue;
int decimals;
double used;
@@ -499,7 +499,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive)
/* do we want to skip this leg as it is devoid of anything useful? */
if (!dp->entered && o2 == newo2 && he == newhe && nextdp && dp->depth != lastdepth && nextdp->depth != dp->depth)
continue;
- get_gas_string(o2, he, gas, 12);
+ get_gas_string(o2, he, gas, sizeof(gas));
gasidx = get_gasidx(dive, o2, he);
len = strlen(buffer);
if (dp->depth != lastdepth) {
@@ -521,7 +521,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive)
gas);
}
consumption[gasidx] += used;
- get_gas_string(newo2, newhe, gas, 12);
+ get_gas_string(newo2, newhe, gas, sizeof(gas));
if (o2 != newo2 || he != newhe) {
len = strlen(buffer);
snprintf(buffer + len, sizeof(buffer) - len, _("Switch gas to %s\n"), gas);
@@ -542,7 +542,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive)
len = strlen(buffer);
volume = get_volume_units(consumption[gasidx], NULL, &unit);
get_gas_string(dive->cylinder[gasidx].gasmix.o2.permille,
- dive->cylinder[gasidx].gasmix.he.permille, gas, 12);
+ dive->cylinder[gasidx].gasmix.he.permille, gas, sizeof(gas));
snprintf(buffer + len, sizeof(buffer) - len, _("%.0f%s of %s\n"), volume, unit, gas);
}
dive->notes = strdup(buffer);