summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-10-23 03:16:51 +0200
committerTreeki <treeki@gmail.com>2012-10-23 03:16:51 +0200
commitf7e35d66b903263b7e31010114cafffd9b8e5055 (patch)
treea4317ff51fd40609e01b749cfeb655111f2e242a /src/koopatlas/pathmanager.cpp
parent9fa22baae0d44278cd73a54c1c4a11eac9255bff (diff)
downloadkamek-f7e35d66b903263b7e31010114cafffd9b8e5055.tar.gz
kamek-f7e35d66b903263b7e31010114cafffd9b8e5055.zip
fixed a buffer overflow Clang revealed
Diffstat (limited to 'src/koopatlas/pathmanager.cpp')
-rw-r--r--src/koopatlas/pathmanager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 032d40b..abcfd76 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -657,12 +657,12 @@ void dWMPathManager_c::moveThroughPath() {
OSReport("Activating world change %d\n", to->worldID);
const dKPWorldDef_s *world = dScKoopatlas_c::instance->mapData.findWorldDef(to->worldID);
if (world) {
- if (strncmp(save->newerWorldName, world->name, 36) == 0) {
+ if (strncmp(save->newerWorldName, world->name, 32) == 0) {
OSReport("Already here\n");
} else {
OSReport("Found!\n");
- strncpy(save->newerWorldName, world->name, 36);
- save->newerWorldName[35] = 0;
+ strncpy(save->newerWorldName, world->name, 32);
+ save->newerWorldName[31] = 0;
save->newerWorldID = world->worldID;
save->currentMapMusic = world->trackID;