From: Mischa POSLAWSKY Date: Sun, 4 Mar 2007 10:05:53 +0000 (+0100) Subject: too much padding X-Git-Url: http://git.shiar.net/netris.git/commitdiff_plain/3893341884fe96131de8e2417d2bdfdf7e42479c too much padding Memory overflow causing some nasty segfaults. --- 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);