]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CObjective.cpp
Get rid of false positive warnings from cppcheck.
[quix0rs-blobwars.git] / src / CObjective.cpp
index a1ca9cc2d151a1effa145c828de9ea52c6d73ad7..b796c0fef45e253a2e9aaea8a9ca575aa3b3b091 100644 (file)
@@ -1,5 +1,6 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -22,8 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 Objective::Objective()
 {
-       strcpy(this->description, "");
-       strcpy(this->target, "");
+       this->description[0] = 0;
+       this->target[0] = 0;
        this->currentValue = 0;
        this->targetValue = 0;
        this->required = false;
@@ -34,8 +35,8 @@ Objective::Objective()
 
 Objective::Objective(const char *description, const char *target, int targetValue, bool required)
 {
-       strcpy(this->description, description);
-       strcpy(this->target, target);
+       strlcpy(this->description, description, sizeof this->description);
+       strlcpy(this->target, target, sizeof this->target);
        this->targetValue = targetValue;
        this->required = required;