Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2005:
[Freeciv-Dev] (PR#14831) Bug in scanin()
Home

[Freeciv-Dev] (PR#14831) Bug in scanin()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14831) Bug in scanin()
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sun, 11 Dec 2005 04:48:30 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14831 >

Because of this bug I couldn't load any game, because scanin() was
overwriting the x variable in savegame code.
--
mateusz
Index: utility/shared.c
===================================================================
--- utility/shared.c    (wersja 11343)
+++ utility/shared.c    (kopia robocza)
@@ -1603,7 +1603,8 @@
   }
 
   if (dest) {
-    strncpy(dest, *buf, size);
+    strncpy(dest, *buf, size-1);
+    dest[size-1] = '\0';
     remove_leading_trailing_spaces(dest);
     ptr = strpbrk(dest, delimiters);
   } else {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#14831) Bug in scanin(), Mateusz Stefek <=