Fix buffer overflow, patch by Typone Alfredo (alfredo@tupone.it).
[gnushogi.git] / gnushogi / commondsp.c
index 73afb95..af9df16 100644 (file)
  *
  */
 
-#include "gnushogi.h"
-
 #if defined HAVE_GETTIMEOFDAY
 #include <sys/time.h>
 #endif
 
-char mvstr[4][6];
-char *InPtr;
-int InBackground = false;
-
-
 #include <ctype.h>
 #include <signal.h>
 
@@ -50,6 +43,11 @@ int InBackground = false;
 #include <sys/file.h>
 
 #include <curses.h>
+#include "gnushogi.h"
+
+char mvstr[4][6];
+char *InPtr;
+int InBackground = false;
 
 
 #if defined(BOOKTEST)
@@ -1737,7 +1735,7 @@ InputCommand(char *command)
                 s[0] = sx[0] = '\0';
 
                 while(!sx[0])
-                    (void)fgets(sx, 256, stdin);
+                    (void)fgets(sx, 80, stdin);
             }
             else
             {