]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CGraphics.cpp
Use strlcat() and strlcpy(), #define wrappers when these functions are not available.
[quix0rs-blobwars.git] / src / CGraphics.cpp
index 353a837febd36331bb01bf4c5bd3e319fc8e614b..6dde3df167f10191bccce5397e3f1db6a6d40e1b 100644 (file)
@@ -616,7 +616,7 @@ void Graphics::loadFont(int i, const char *filename, int pixelSize)
 Sprite *Graphics::addSprite(const char *name)
 {
        Sprite *sprite = new Sprite;
-       strncpy(sprite->name, name, sizeof sprite->name);
+       strlcpy(sprite->name, name, sizeof sprite->name);
 
        spriteList.add(sprite);
 
@@ -946,8 +946,8 @@ void Graphics::clearChatString()
 
 void Graphics::createChatString(const char *in)
 {
-       strncat(chatString, " ", sizeof chatString);
-       strncat(chatString, in, sizeof chatString);
+       strlcat(chatString, " ", sizeof chatString);
+       strlcat(chatString, in, sizeof chatString);
 }
 
 void Graphics::drawChatString(SDL_Surface *surface, int y)