diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c
index 9d94d76ada68e8a0631878ae2c375539c7b8d12c..ec0a426fed592202becadd636cb13e10dc31e973 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++;
 		}