diff options
Diffstat (limited to 'src/common/mapindex.c')
-rw-r--r-- | src/common/mapindex.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 035518f68..aa31d8090 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -6,18 +6,18 @@ #include "mapindex.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/strlib.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" /* mapindex.c interface source */ struct mapindex_interface mapindex_s; +struct mapindex_interface *mapindex; /// Retrieves the map name from 'string' (removing .gat extension if present). /// Result gets placed either into 'buf' or in a static local buffer. @@ -125,7 +125,7 @@ unsigned short mapindex_name2id(const char* name) { return 0; } -const char* mapindex_id2name_sub(unsigned short id,const char *file, int line, const char *func) { +const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func) { if (id >= MAX_MAPINDEX || !mapindex_exists(id)) { ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache. %s:%s:%d\n", id,file,func,line); return mapindex->list[0].name; // dummy empty string so that the callee doesn't crash @@ -193,7 +193,7 @@ void mapindex_defaults(void) { mapindex = &mapindex_s; /* TODO: place it in inter-server.conf? */ - snprintf(mapindex->config_file, 80, "%s","db/map_index.txt"); + snprintf(mapindex->config_file, sizeof(mapindex->config_file), "%s","db/map_index.txt"); /* */ mapindex->db = NULL; mapindex->num = 0; |