stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/stratagus stratagus.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/stratagus stratagus.c
Date: 1 Feb 2004 07:12:32 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/02/01 07:12:32

Modified files:
        src/stratagus  : stratagus.c 

Log message:
        Use sizeof(LocalPlayerName)

Patches:
Index: stratagus/src/stratagus/stratagus.c
diff -u stratagus/src/stratagus/stratagus.c:1.261 
stratagus/src/stratagus/stratagus.c:1.262
--- stratagus/src/stratagus/stratagus.c:1.261   Sun Feb  1 07:06:57 2004
+++ stratagus/src/stratagus/stratagus.c Sun Feb  1 07:12:31 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: stratagus.c,v 1.261 2004/01/31 20:06:57 nobody_ Exp $
+//      $Id: stratagus.c,v 1.262 2004/01/31 20:12:31 jsalmon3 Exp $
 
 //@{
 
@@ -971,8 +971,8 @@
        CclStartFile = "scripts/stratagus.lua";
        EditorStartFile = "scripts/editor.lua";
 
-       //  Default play name to username on unix systems.
-       memset(LocalPlayerName, 0, 16);
+       //  Default player name to username on unix systems.
+       memset(LocalPlayerName, 0, sizeof(LocalPlayerName));
 #ifdef USE_WIN32
        strcpy(LocalPlayerName, "Anonymous");
 #else
@@ -1015,8 +1015,8 @@
                                NetworkArg = strdup(optarg);
                                continue;
                        case 'N':
-                               memset(LocalPlayerName, 0, 16);
-                               strncpy(LocalPlayerName, optarg, 16);
+                               memset(LocalPlayerName, 0, 
sizeof(LocalPlayerName));
+                               strncpy(LocalPlayerName, optarg, 
sizeof(LocalPlayerName) - 1);
                                continue;
                        case 's':
                                AiSleepCycles = atoi(optarg);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]