mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f45285d461
commit
bfd6ce0f1f
1 changed files with 5 additions and 4 deletions
9
info.c
9
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue