summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-16 08:33:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-16 08:33:03 -0700
commitbfd6ce0f1faea3a11127f6d945a6acdc659487d0 (patch)
treeb6a4bb157df82f76b009d8d9e9a6757b6907e51d /info.c
parentf45285d461a6125a9ad1968130823f3d3e366090 (diff)
downloadsubsurface-bfd6ce0f1faea3a11127f6d945a6acdc659487d0.tar.gz
Localization prevents us from from making assumptions about string length
Restructure some code to work around that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/info.c b/info.c
index 61a2bebe3..8437c7318 100644
--- a/info.c
+++ b/info.c
@@ -141,13 +141,14 @@ void show_dive_info(struct dive *dive)
if (!text)
text = "";
if (*text) {
- snprintf(buffer, sizeof(buffer), _("Dive #%d - %s"), dive->number, text);
+ if (dive->number) {
+ snprintf(buffer, sizeof(buffer), _("Dive #%d - %s"), dive->number, text);
+ text = buffer;
+ }
} else {
divename(buffer, sizeof(buffer), dive);
+ text = buffer;
}
- text = buffer;
- if (!dive->number)
- text += 10; /* Skip the "Dive #0 - " part */
/* put it all together */
if (existing_filename) {