summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-09 11:02:44 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-09 11:02:44 +0000
commitc10d6dd38c9fff3ea0ec335465b7f632d5b086db (patch)
tree6c5c6ce4e7392a8a0645dc132d7f21f325b0cb99 /src/common
parent8422b98a28e183d714d721a0b201391e183fb546 (diff)
downloadhercules-c10d6dd38c9fff3ea0ec335465b7f632d5b086db.tar.gz
hercules-c10d6dd38c9fff3ea0ec335465b7f632d5b086db.tar.bz2
hercules-c10d6dd38c9fff3ea0ec335465b7f632d5b086db.tar.xz
hercules-c10d6dd38c9fff3ea0ec335465b7f632d5b086db.zip
The new functions now clear junk from the output buffer, this simplifies the code a bit.
Added a TODO for one emblem loading problem/crash. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10969 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mapindex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index 7e55daff8..a7f7aca5a 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -39,7 +39,8 @@ const char* mapindex_getmapname(const char* string, char* output)
len -= 4; // strip .gat extension
len = min(len, MAP_NAME_LENGTH-1);
- safestrncpy(dest, string, len+1);
+ strncpy(dest, string, len+1);
+ memset(&dest[len], '\0', MAP_NAME_LENGTH-len);
return dest;
}
@@ -57,12 +58,14 @@ const char* mapindex_getmapname_ext(const char* string, char* output)
len--;
}
- safestrncpy(dest, string, len+1);
+ strncpy(dest, string, len+1);
if (len < 4 || stricmp(&dest[len-4], ".gat") != 0) {
strcpy(&dest[len], ".gat");
len += 4; // add .gat extension
}
+
+ memset(&dest[len], '\0', MAP_NAME_LENGTH_EXT-len);
return dest;
}