]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CSwitch.cpp
Don't link pak tool with SDL.
[quix0rs-blobwars.git] / src / CSwitch.cpp
index ae39a2a02a909ecb2ca3e8926905e55f14d8e642..f7e02981a182508b14c3f64764da425f8536bbd7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -22,10 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 Switch::Switch()
 {
-       strcpy(this->name, "");
-       strcpy(this->linkName, "");
-       strcpy(this->requiredObjectName, "");
-       strcpy(this->activateMessage, "");
+       this->name[0] = 0;
+       this->linkName[0] = 0;
+       this->requiredObjectName[0] = 0;
+       this->activateMessage[0] = 0;
 
        type = 0;
        x = y = 0;
@@ -37,10 +37,10 @@ Switch::Switch()
 
 void Switch::set(const char *name, const char *linkName, const char *requiredObjectName, const char *activateMessage, int type, int x, int y, bool activated)
 {
-       strcpy(this->name, name);
-       strcpy(this->linkName, linkName);
-       strcpy(this->requiredObjectName, requiredObjectName);
-       strcpy(this->activateMessage, activateMessage);
+       strlcpy(this->name, name, sizeof this->name);
+       strlcpy(this->linkName, linkName, sizeof this->linkName);
+       strlcpy(this->requiredObjectName, requiredObjectName, sizeof this->requiredObjectName);
+       strlcpy(this->activateMessage, activateMessage, sizeof this->activateMessage);
        this->type = type;
        this->x = x;
        this->y = y;