From 1b6c3321184b41b4c76fd5699140f8b5b494c0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Thu, 10 Feb 2022 19:23:29 -0500 Subject: [PATCH] Actually constify showbuf() Geeze, this is ugly. --- src/uifc/uifc32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 9d94d76ada..ec0a426fed 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -2755,7 +2755,6 @@ void showbuf(int mode, int left, int top, int width, int height, const char *tit tmp_buffer2[0].ch=api->chars->help_top_left; j=title_len; if(j>width-6) { - *(title+width-6)=0; j=width-6; } for(i=1;i<(width-j)/2;i++) @@ -2769,7 +2768,7 @@ void showbuf(int mode, int left, int top, int width, int height, const char *tit } tmp_buffer2[i].ch = api->chars->help_titlebreak_left; i+=2; - for(pc=title;*pc;pc++) { + for(pc=title;*pc && pc < &title[j];pc++) { tmp_buffer2[i].ch=*pc; i++; } -- GitLab