From 3893341884fe96131de8e2417d2bdfdf7e42479c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 4 Mar 2007 11:05:53 +0100 Subject: [PATCH] too much padding Memory overflow causing some nasty segfaults. --- curses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses.c b/curses.c index 7b5a26d..5856f65 100644 --- a/curses.c +++ b/curses.c @@ -213,7 +213,7 @@ void DrawTitle(void) s = malloc(cols + 1); sprintf(s, " " MSG_TITLE " %s", version_string); const int titlelen = strlen(s); - memset(&s[titlelen], ' ', cols - strlen(MSG_TITLE)); // pad + memset(&s[titlelen], ' ', cols - titlelen); // pad if (cols > titlelen + 1 + strlen(MSG_TITLESUB)) memcpy(&s[cols - 1 - strlen(MSG_TITLESUB)], MSG_TITLESUB, sizeof(MSG_TITLESUB) - 1); memcpy(&s[cols], "\0", 1); -- 2.30.0