]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CPersistData.cpp
Prevent a segmentation fault when using the -map option without specifying a map.
[quix0rs-blobwars.git] / src / CPersistData.cpp
index 9150c003add61e315d8fc13488e552a6c7963ce4..3a913ba82df63bbe22cfe13e1924f356438656fe 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,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 PersistData::PersistData()
 {
-       strcpy(data, "");
+       data[0] = 0;
 }
 
 PersistData::~PersistData()
@@ -37,7 +38,7 @@ bool PersistData::setData(const char *data)
                return false;
        }
        
-       strcpy(this->data, data);
+       strlcpy(this->data, data, sizeof this->data);
        
        return true;
 }