From: Holger Schemel Date: Sun, 18 Dec 2022 10:47:56 +0000 (+0100) Subject: fixed text length calculation bug X-Git-Tag: 4.3.4.0~1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=03961813964d45f7f1d663ff5b6d2f91ee5f0f02;p=rocksndiamonds.git fixed text length calculation bug --- diff --git a/src/screens.c b/src/screens.c index bf495c15..d6487970 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1579,8 +1579,9 @@ static void DrawInfoScreen_Headline(int screen_nr, int num_screens, else { char *text_format = (use_global_screens ? "for %s" : "for \"%s\""); + int text_format_len = strlen(text_format) - strlen("%s"); int max_text_len = SXSIZE / getFontWidth(FONT_TITLE_2); - int max_name_len = max_text_len - strlen(text_format) - strlen("%s"); + int max_name_len = max_text_len - text_format_len; char name_cut[max_name_len]; char *name_full = (use_global_screens ? getProgramTitleString() : leveldir_current->name);