foxygit / doom Log in
commit 5a63dede9be5a1a126debc57be3075e565bc1248
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Wed Feb 14 19:11:03 2007 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Wed Feb 14 19:11:03 2007 +0000

    Expand buffer length to fix bug on Windows with cycling character on the
    quicksave screen.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 835
---
 src/m_menu.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/m_menu.c b/src/m_menu.c
index 55a4a639..456d38ec 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -1804,42 +1804,42 @@ void M_Drawer (void)
     static short	y;
     unsigned int	i;
     unsigned int	max;
-    char		string[40];
+    char		string[80];
     char               *name;
     int			start;

     inhelpscreens = false;
-

     // Horiz. & Vertically center string and print it.
     if (messageToPrint)
     {
 	start = 0;
-	y = 100 - M_StringHeight(messageString)/2;
-	while(*(messageString+start))
+	y = 100 - M_StringHeight(messageString) / 2;
+	while (messageString[start] != '\0')
 	{
 	    int foundnewline = 0;

-	    for (i = 0;i < strlen(messageString+start);i++)
-		if (*(messageString+start+i) == '\n')
+	    for (i = 0; i < strlen(messageString + start); i++)
+		if (messageString[start + i] == '\n')
 		{
-		    memset(string,0,40);
-		    strncpy(string,messageString+start,i);
+		    memset(string, 0, 40);
+		    strncpy(string, messageString + start, i);
 		    foundnewline = 1;
-		    start += i+1;
+		    start += i + 1;
 		    break;
 		}

 	    if (!foundnewline)
 	    {
-		strcpy(string,messageString+start);
+		strcpy(string, messageString + start);
 		start += strlen(string);
 	    }

-	    x = 160 - M_StringWidth(string)/2;
-	    M_WriteText(x,y,string);
+	    x = 160 - M_StringWidth(string) / 2;
+	    M_WriteText(x, y, string);
 	    y += SHORT(hu_font[0]->height);
 	}
+
 	return;
     }