line[l - 1] = 0;
if(!strncasecmp(line, "title=", 6))
- strncpy(songtitle, line + 6, sizeof songtitle);
+ strlcpy(songtitle, line + 6, sizeof songtitle);
else if(!strncasecmp(line, "album=", 6))
- strncpy(songalbum, line + 6, sizeof songalbum);
+ strlcpy(songalbum, line + 6, sizeof songalbum);
else if(!strncasecmp(line, "artist=", 7))
- strncpy(songartist, line + 7, sizeof songartist);
+ strlcpy(songartist, line + 7, sizeof songartist);
else if(!strncasecmp(line, "license=", 8))
{
if(!strncasecmp(line + 8, "CC-BY ", 6))
if(fp)
fclose(fp);
- strncpy(levelMusicName, filename, sizeof levelMusicName);
+ strlcpy(levelMusicName, filename, sizeof levelMusicName);
return true;
}
void Cutscene::appendText(const char *line)
{
- strncat(text, " ", sizeof text);
- strncat(text, line, sizeof text);
+ strlcat(text, " ", sizeof text);
+ strlcat(text, line, sizeof text);
}
return;
}
- strncpy(this->key, key, sizeof this->key);
- strncpy(this->value, value, sizeof this->value);
+ strlcpy(this->key, key, sizeof this->key);
+ strlcpy(this->value, value, sizeof this->value);
this->current = current;
this->target = target;
}
binaryBuffer = NULL;
#ifdef FRAMEWORK_SDL
char pakPath[PATH_MAX];
- strncpy(pakPath, PAKFULLPATH, sizeof(pakPath));
+ strlcpy(pakPath, PAKFULLPATH, sizeof(pakPath));
if (CFBundleGetMainBundle() != NULL) {
CFURLRef pakURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR(PAKNAME), NULL, NULL);
if (pakURL != NULL) {
}
keyState[event.key.keysym.sym] = 1;
- strncpy(lastKeyPressed, SDL_GetKeyName(event.key.keysym.sym), sizeof lastKeyPressed);
+ strlcpy(lastKeyPressed, SDL_GetKeyName(event.key.keysym.sym), sizeof lastKeyPressed);
addKeyEvent();
break;
void Engine::setUserHome(const char *path)
{
- strncpy(userHomeDirectory, path, sizeof userHomeDirectory);
+ strlcpy(userHomeDirectory, path, sizeof userHomeDirectory);
debug(("User Home = %s\n", path));
}
{
if (priority >= messagePriority)
{
- strncpy(this->message, message, sizeof this->message);
+ strlcpy(this->message, message, sizeof this->message);
messageTime = 180;
messagePriority = priority;
messageType = type;
char line[1024];
bool found;
int value;
- strncpy(line, realLine, sizeof line);
+ strlcpy(line, realLine, sizeof line);
int flags = 0;
void Entity::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
}
void Entity::setSprites(Sprite *sprite1, Sprite *sprite2, Sprite *sprite3)
return;
}
- strncpy(this->filename, filename, sizeof this->filename);
+ strlcpy(this->filename, filename, sizeof this->filename);
this->fSize = fSize;
this->cSize = cSize;
bulletsHit[i] = bulletsFired[i] = 0;
}
- strncpy(mapName, "data/grasslands1", sizeof mapName);
- strncpy(stageName, "Grasslands", sizeof stageName);
+ strlcpy(mapName, "data/grasslands1", sizeof mapName);
+ strlcpy(stageName, "Grasslands", sizeof stageName);
continuesUsed = 0;
levelsStarted = 0;
void Game::setStageName(const char *name)
{
- strncpy(stageName, name, sizeof stageName);
+ strlcpy(stageName, name, sizeof stageName);
}
void Game::setMapName(const char *name)
{
- strncpy(mapName, name, sizeof mapName);
+ strlcpy(mapName, name, sizeof mapName);
}
void Game::setMissionOver(int reason)
data = (Data*)data->next;
if (strcmp(newKey, data->key) == 0)
{
- strncpy(data->value, "MIAs", sizeof data->value);
+ strlcpy(data->value, "MIAs", sizeof data->value);
data->current = rescues;
data->target = total;
return;
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);
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)
void HubLevel::set(const char *stageName, const char *filename, int x, int y)
{
- strncpy(this->stageName, stageName, sizeof this->stageName);
- strncpy(this->filename, filename, sizeof this->filename);
+ strlcpy(this->stageName, stageName, sizeof this->stageName);
+ strlcpy(this->filename, filename, sizeof this->filename);
this->x = x;
this->y = y;
}
return "...";
}
- strncpy(keyName, _(SDL_GetKeyName((SDLKey)key)), sizeof keyName);
+ strlcpy(keyName, _(SDL_GetKeyName((SDLKey)key)), sizeof keyName);
/*
This is not really neccessary, but it just makes
void LineDef::set(const char *name, const char *linkName, const char *activateMessage, int x, int y, int width, int height)
{
- strncpy(this->name, name, sizeof this->name);
- strncpy(this->linkName, linkName, sizeof this->linkName);
- strncpy(this->activateMessage, activateMessage, sizeof this->activateMessage);
+ strlcpy(this->name, name, sizeof this->name);
+ strlcpy(this->linkName, linkName, sizeof this->linkName);
+ strlcpy(this->activateMessage, activateMessage, sizeof this->activateMessage);
this->x = x;
this->y = y;
this->width = width;
if (strcmp(p->stageName, name) == 0)
{
- strncpy(p->stageName, "@none@", sizeof p->stageName);
+ strlcpy(p->stageName, "@none@", sizeof p->stageName);
p->clear();
return;
}
void Map::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
if (strstr(name, "BioMech"))
{
debug(("Connected %s to %s:%d\n", privateKey, MEDAL_SERVER_HOST, MEDAL_SERVER_PORT));
- strncpy(this->privateKey, privateKey, sizeof this->privateKey);
+ strlcpy(this->privateKey, privateKey, sizeof this->privateKey);
connected = true;
return true;
char *store;
char medal[128];
- strncpy(medal, str, sizeof medal);
+ strlcpy(medal, str, sizeof medal);
for (unsigned int i = 0 ; i < strlen(medal) ; i++)
{
if (response == 4)
{
- strncpy(rubyMessage, message, sizeof rubyMessage);
+ strlcpy(rubyMessage, message, sizeof rubyMessage);
gotRuby = true;
}
else
Objective::Objective(const char *description, const char *target, int targetValue, bool required)
{
- strncpy(this->description, description, sizeof this->description);
- strncpy(this->target, target, sizeof this->target);
+ strlcpy(this->description, description, sizeof this->description);
+ strlcpy(this->target, target, sizeof this->target);
this->targetValue = targetValue;
this->required = required;
void Pak::setPakFile(const char *pakFilename)
{
#if USEPAK
- strncpy(this->pakFilename, pakFilename, sizeof this->pakFilename);
+ strlcpy(this->pakFilename, pakFilename, sizeof this->pakFilename);
debug(("Pak : Filename set to %s\n", pakFilename));
return false;
}
- strncpy(this->data, data, sizeof this->data);
+ strlcpy(this->data, data, sizeof this->data);
return true;
}
void Persistant::setName(const char *name)
{
- strncpy(this->stageName, name, sizeof this->stageName);
+ strlcpy(this->stageName, name, sizeof this->stageName);
}
void Persistant::clear()
void SpawnPoint::create(const char *name, int x, int y, int spawnType, int spawnSubType, int minInterval, int maxInterval, bool active)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
this->x = x;
this->y = y;
this->spawnType = spawnType;
void Switch::set(const char *name, const char *linkName, const char *requiredObjectName, const char *activateMessage, int type, int x, int y, bool activated)
{
- strncpy(this->name, name, sizeof this->name);
- strncpy(this->linkName, linkName, sizeof this->linkName);
- strncpy(this->requiredObjectName, requiredObjectName, sizeof this->requiredObjectName);
- strncpy(this->activateMessage, activateMessage, sizeof this->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;
void Teleporter::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
}
void Teleporter::set(int x, int y, int destX, int destY)
void Train::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
}
void Train::set(int startX, int startY, int endX, int endY, int pause, bool fromStart)
void Trap::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
}
void Trap::setTrapType(int type)
void Weapon::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
}
int Weapon::getSpeed(int face)
exit(1);
}
- strncpy(this->name, name, sizeof this->name);
- strncpy(this->groupName, groupName, sizeof this->groupName);
- strncpy(this->label, label, sizeof this->label);
- strncpy(this->options, options, sizeof this->options);
+ strlcpy(this->name, name, sizeof this->name);
+ strlcpy(this->groupName, groupName, sizeof this->groupName);
+ strlcpy(this->label, label, sizeof this->label);
+ strlcpy(this->options, options, sizeof this->options);
this->x = x;
this->y = y;
this->min = min;
debug(("aquaBossMainInit\n"));
map.boss[0] = new Boss();
- strncpy(map.boss[0]->name, "BioMech Aqua Blob", sizeof map.boss[0]->name);
+ strlcpy(map.boss[0]->name, "BioMech Aqua Blob", sizeof map.boss[0]->name);
map.boss[0]->health = 45 * game.skill;
map.boss[0]->maxHealth = 45 * game.skill;
map.boss[0]->setSprites(graphics.getSprite("AquaBossRight", true), graphics.getSprite("AquaBossLeft", true), graphics.getSprite("AquaBossLeft", true));
line = strtok(NULL, "\n");
if (strcmp(line, "@none@") != 0)
{
- strncpy(scene->sprite, line, sizeof scene->sprite);
+ strlcpy(scene->sprite, line, sizeof scene->sprite);
debug(("Loading cutscene image %s\n", scene->sprite));
graphics.quickSprite(scene->sprite, graphics.loadImage(scene->sprite));
}
debug(("droidBossInit\n"));
map.boss[0] = new Boss();
- strncpy(map.boss[0]->name, "BioMech Jetpack Blob", sizeof map.boss[0]->name);
+ strlcpy(map.boss[0]->name, "BioMech Jetpack Blob", sizeof map.boss[0]->name);
map.boss[0]->health = 30 * game.skill;
map.boss[0]->maxHealth = 30 * game.skill;
map.boss[0]->setSprites(graphics.getSprite("JetpackBlobRight1", true), graphics.getSprite("JetpackBlobLeft1", true), graphics.getSprite("JetpackBlobLeft1", true));
for (int i = 1 ; i < 6 ; i++)
{
map.boss[i] = new Boss();
- strncpy(map.boss[i]->name, "Orb Bomb", sizeof map.boss[i]->name);
+ strlcpy(map.boss[i]->name, "Orb Bomb", sizeof map.boss[i]->name);
map.boss[i]->setSprites(graphics.getSprite("DroidOrb", true), graphics.getSprite("DroidOrb", true), graphics.getSprite("DroidOrb", true));
map.boss[i]->active = false;
map.boss[i]->face = 1;
map.boss[i] = new Boss();
}
debug(("BlackDroid %d init\n", i));
- strncpy(map.boss[i]->name, "BlackDrod", sizeof map.boss[i]->name);
+ strlcpy(map.boss[i]->name, "BlackDrod", sizeof map.boss[i]->name);
map.boss[i]->health = -90;
map.boss[i]->maxHealth = -90;
map.boss[i]->setSprites(graphics.getSprite("BlackDroidRight", true), graphics.getSprite("BlackDroidLeft", true), graphics.getSprite("BlackDroidDie", true));
if (map.boss[i] == NULL)
{
map.boss[i] = new Boss();
- strncpy(map.boss[i]->name, "MiniGaldov", sizeof map.boss[i]->name);
+ strlcpy(map.boss[i]->name, "MiniGaldov", sizeof map.boss[i]->name);
map.boss[i]->health = 10 * game.skill;
map.boss[i]->maxHealth = 10 * game.skill;
}
debug(("galdovFinalInit\n"));
map.boss[0] = new Boss();
- strncpy(map.boss[0]->name, "Galdov", sizeof map.boss[0]->name);
+ strlcpy(map.boss[0]->name, "Galdov", sizeof map.boss[0]->name);
map.boss[0]->health = 45 * game.skill;
map.boss[0]->maxHealth = 45 * game.skill;
map.boss[0]->setSprites(graphics.getSprite("GaldovRight", true), graphics.getSprite("GaldovLeft", true), graphics.getSprite("GaldovDie", true));
delete map.boss[i];
}
map.boss[i] = new Boss();
- strncpy(map.boss[i]->name, "OrbBomb", sizeof map.boss[i]->name);
+ strlcpy(map.boss[i]->name, "OrbBomb", sizeof map.boss[i]->name);
map.boss[i]->setSprites(graphics.getSprite("DroidOrb", true), graphics.getSprite("DroidOrb", true), graphics.getSprite("DroidOrb", true));
map.boss[i]->health = 999999;
map.boss[i]->maxHealth = 99999;
debug(("galdovInit\n"));
map.boss[0] = new Boss();
- strncpy(map.boss[0]->name, "Galdov", sizeof map.boss[0]->name);
+ strlcpy(map.boss[0]->name, "Galdov", sizeof map.boss[0]->name);
map.boss[0]->health = 45 * game.skill;
map.boss[0]->maxHealth = 45 * game.skill;
map.boss[0]->setSprites(graphics.getSprite("GaldovRight", true), graphics.getSprite("GaldovLeft", true), graphics.getSprite("GaldovLeft", true));
for (int i = 1 ; i < 10 ; i++)
{
map.boss[i] = new Boss();
- strncpy(map.boss[i]->name, "Fake", sizeof map.boss[i]->name);
+ strlcpy(map.boss[i]->name, "Fake", sizeof map.boss[i]->name);
map.boss[i]->setSprites(graphics.getSprite("GaldovRight", true), graphics.getSprite("GaldovLeft", true), graphics.getSprite("GaldovLeft", true));
map.boss[i]->x = 9999;
map.boss[i]->y = 9999;
Widget *widget = engine.getWidgetByName("gameOverNo");
char postfix[100];
snprintf(postfix, sizeof postfix, " (%d)", game.canContinue);
- strncat(widget->label, postfix, sizeof widget->label);
+ strlcat(widget->label, postfix, sizeof widget->label);
}
while (true)
#if DEBUG
Uint32 now;
char fps[10];
- strncpy(fps, "fps", sizeof fps);
+ strlcpy(fps, "fps", sizeof fps);
#endif
engine.messageTime = -1;
#include <libintl.h>
#define _(string) gettext(string)
+#if !defined(OpenBSD) && !defined(FreeBSD)
+#define strlcat(dest, src, n) strncat((dest), (src), (n) - 1)
+#define strlcpy(dest, src, n) do {strncpy((dest), (src), (n)); (dest)[(n) - 1] = 0;} while(false)
+#endif
+
#include "defs.h"
#include "CMath.h"
}
else
{
- strncpy(string, _(data->value), sizeof string);
+ strlcpy(string, _(data->value), sizeof string);
if (strlen(string) >= 25)
{
int rtn = -1;
- strncpy(level, "@none@", sizeof level);
- strncpy(game.stageName, "@none@", sizeof game.stageName);
+ strlcpy(level, "@none@", sizeof level);
+ strlcpy(game.stageName, "@none@", sizeof game.stageName);
bool showData = false;
bool showStats = false;
if ((numberOfHubs == 0) && (gameData.completedWorld))
{
game.setMapName("data/spaceStation");
- strncpy(game.stageName, "Space Station", sizeof game.stageName);
+ strlcpy(game.stageName, "Space Station", sizeof game.stageName);
createObjectivesPanel("Space Station");
showData = true;
showStats = showMIAs = false;
if (!fp)
{
- strncpy(string, "%.2d - %s", sizeof string);
+ strlcpy(string, "%.2d - %s", sizeof string);
snprintf(engine.saveSlot[i], sizeof engine.saveSlot[i], string, (i + 1), _("Empty"));
}
else
{
if (fread(&tempGame, sizeof(Game), 1, fp) != 1)
{
- strncpy(string, "%.2d - %s", sizeof string);
+ strlcpy(string, "%.2d - %s", sizeof string);
snprintf(engine.saveSlot[i], sizeof engine.saveSlot[i], string, (i + 1), _("Corrupt Save Data"));
}
else
fgets(line, 1024, fp);
sscanf(line, "%[^\n\r]", string[0]);
- strncpy(stageName, string[0], sizeof stageName);
+ strlcpy(stageName, string[0], sizeof stageName);
if (strcmp(stageName, "@EOF@") == 0)
{
fgets(line, 1024, fp);
- strncpy(persistData->data, line, sizeof persistData->data);
+ strlcpy(persistData->data, line, sizeof persistData->data);
//debug(("Read %d: %s", i, persistData->data));
for (int i = 0 ; i < 5 ; i++)
{
snprintf(widgetName, sizeof widgetName, "slot%d", i + 1);
- strncpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
+ strlcpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
}
engine.highlightWidget("slot1");
else if (strcmp(argv[i], "-mono") == 0) engine.useAudio = 1;
else if (strcmp(argv[i], "-version") == 0) showVersion();
else if (strcmp(argv[i], "--help") == 0) showHelp();
- else if (strcmp(argv[i], "-record") == 0) {recordMode = REPLAY_MODE::RECORD; strncpy(replayData.filename, argv[++i], sizeof replayData.filename);}
- else if (strcmp(argv[i], "-playback") == 0) {recordMode = REPLAY_MODE::PLAYBACK; strncpy(replayData.filename, argv[++i], sizeof replayData.filename);}
+ else if (strcmp(argv[i], "-record") == 0) {recordMode = REPLAY_MODE::RECORD; strlcpy(replayData.filename, argv[++i], sizeof replayData.filename);}
+ else if (strcmp(argv[i], "-playback") == 0) {recordMode = REPLAY_MODE::PLAYBACK; strlcpy(replayData.filename, argv[++i], sizeof replayData.filename);}
else if (strcmp(argv[i], "-map") == 0) {game.setMapName(argv[++i]); requiredSection = SECTION_GAME;}
else if (strcmp(argv[i], "-listmaps") == 0) listMaps();
else if (strcmp(argv[i], "-credits") == 0) requiredSection = SECTION_CREDITS;
case REPLAY_MODE::RECORD:
requiredSection = SECTION_GAME;
- strncpy(replayData.header.map, game.mapName, sizeof replayData.header.map);
+ strlcpy(replayData.header.map, game.mapName, sizeof replayData.header.map);
replayData.header.skill = game.skill = 3;
replayData.setMode(REPLAY_MODE::RECORD);
break;
if (!strstr(string, " ENEMY \""))
{
str = new String;
- strncpy(str->string, string, sizeof str->string);
+ strlcpy(str->string, string, sizeof str->string);
stringTail->next = str;
stringTail = str;
}
void initMIAPhrases()
{
- strncpy(mia_scared[0], "help me...", sizeof mia_scared[0]);
- strncpy(mia_scared[1], "i don't wanna die...", sizeof mia_scared[1]);
- strncpy(mia_scared[2], "please... someone help...", sizeof mia_scared[2]);
- strncpy(mia_scared[3], "i... i'm scared...", sizeof mia_scared[3]);
- strncpy(mia_scared[4], "i wanna go home...", sizeof mia_scared[4]);
- strncpy(mia_scared[5], "what was that?!", sizeof mia_scared[5]);
- strncpy(mia_scared[6], "i don't like it here...", sizeof mia_scared[6]);
+ strlcpy(mia_scared[0], "help me...", sizeof mia_scared[0]);
+ strlcpy(mia_scared[1], "i don't wanna die...", sizeof mia_scared[1]);
+ strlcpy(mia_scared[2], "please... someone help...", sizeof mia_scared[2]);
+ strlcpy(mia_scared[3], "i... i'm scared...", sizeof mia_scared[3]);
+ strlcpy(mia_scared[4], "i wanna go home...", sizeof mia_scared[4]);
+ strlcpy(mia_scared[5], "what was that?!", sizeof mia_scared[5]);
+ strlcpy(mia_scared[6], "i don't like it here...", sizeof mia_scared[6]);
}
void addMIA(const char *name, int x, int y, int type)
{
Entity *mia = new Entity();
- strncpy(mia->name, name, sizeof mia->name);
+ strlcpy(mia->name, name, sizeof mia->name);
mia->id = type;
mia->baseThink = 60;
mia->health = 180;
// Copy the input, so that threading
// doesn't trip us up!
char *data = new char[128];
- strncpy(data, tname, sizeof data);
+ strlcpy(data, tname, sizeof data);
SDL_Thread *thread = SDL_CreateThread(medalWorker, (void*)data);
if (swt->type == SWT_PRESSURE)
{
- strncpy(swt->requiredObjectName, "@none@", sizeof swt->requiredObjectName);
+ strlcpy(swt->requiredObjectName, "@none@", sizeof swt->requiredObjectName);
}
checkObjectives(swt->name, true);
- strncpy(swt->name, "Switch", sizeof swt->name);
+ strlcpy(swt->name, "Switch", sizeof swt->name);
}
else
{
debug(("tankBossMGInit\n"));
map.boss[0] = new Boss();
- strncpy(map.boss[0]->name, "BioMech Tank V1.1", sizeof map.boss[0]->name);
+ strlcpy(map.boss[0]->name, "BioMech Tank V1.1", sizeof map.boss[0]->name);
map.boss[0]->health = 65 * game.skill;
map.boss[0]->maxHealth = 65 * game.skill;
map.boss[0]->setSprites(graphics.getSprite("BlobTankCannonRight", true), graphics.getSprite("BlobTankCannonLeft", true), graphics.getSprite("BlobTankCannonLeft", true));
debug(("tankBossGLInit\n"));
map.boss[1] = new Boss();
- strncpy(map.boss[1]->name, "BioMech Tank V2.6", sizeof map.boss[1]->name);
+ strlcpy(map.boss[1]->name, "BioMech Tank V2.6", sizeof map.boss[1]->name);
map.boss[1]->health = 65 * game.skill;
map.boss[1]->maxHealth = 65 * game.skill;
map.boss[1]->setSprites(graphics.getSprite("BlobTankGrenadeRight", true), graphics.getSprite("BlobTankGrenadeLeft", true), graphics.getSprite("BlobTankGrenadeLeft", true));
for (int i = 0 ; i < 5 ; i++)
{
snprintf(widgetName, sizeof widgetName, "save%d", i + 1);
- strncpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
+ strlcpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
if ((strstr(engine.saveSlot[i], _("Empty"))) || (strstr(engine.saveSlot[i], _("Corrupt"))))
{
}
snprintf(widgetName, sizeof widgetName, "slot%d", i + 1);
- strncpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
+ strlcpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
}
}
setupSaveWidgets();
Widget *widget = engine.getWidgetByName("labelManual");
- strncpy(widget->label, GAMEPLAYMANUAL, sizeof widget->label);
+ strlcpy(widget->label, GAMEPLAYMANUAL, sizeof widget->label);
showTitleWidgets();
}