summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-30 18:21:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-30 20:37:26 +0300
commit2000a698da35915afb1a598433337a735d27ae24 (patch)
tree119c8d409657cee1d90cd0c072ef3b7e846fa3f0 /src/map/map.c
parent84ecefb4db23bbd98194a43a592cfe313477a1ab (diff)
downloadhercules-2000a698da35915afb1a598433337a735d27ae24.tar.gz
hercules-2000a698da35915afb1a598433337a735d27ae24.tar.bz2
hercules-2000a698da35915afb1a598433337a735d27ae24.tar.xz
hercules-2000a698da35915afb1a598433337a735d27ae24.zip
Add different fixes for gcc 7 warnings.
Some possible buffer overflows. Add attribute for mark fallthrough cases. Skipped libconfig warnings.
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 47e22fa9b..0a60a92b4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1929,6 +1929,7 @@ int map_quit(struct map_session_data *sd) {
case SC_GDSKILL_REGENERATION:
if( !sd->sc.data[i]->val4 )
break;
+ FALLTHROUGH
default:
status_change_end(&sd->bl, (sc_type)i, INVALID_TIMER);
}
@@ -3738,8 +3739,8 @@ int map_readallmaps (void) {
if( map->enable_grf )
ShowStatus("Loading maps (using GRF files)...\n");
else {
- char mapcachefilepath[254];
- sprintf(mapcachefilepath,"%s/%s%s",map->db_path,DBPATH,"map_cache.dat");
+ char mapcachefilepath[256];
+ snprintf(mapcachefilepath, 256, "%s/%s%s", map->db_path, DBPATH, "map_cache.dat");
ShowStatus("Loading maps (using %s as map cache)...\n", mapcachefilepath);
if( (fp = fopen(mapcachefilepath, "rb")) == NULL ) {
ShowFatalError("Unable to open map cache file "CL_WHITE"%s"CL_RESET"\n", mapcachefilepath);
@@ -4394,7 +4395,7 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone
nullpo_retr(NULL, main);
nullpo_retr(NULL, other);
- sprintf(newzone, "%s+%s",main->name,other->name);
+ snprintf(newzone, MAP_ZONE_NAME_LENGTH, "%s+%s", main->name, other->name);
if( (zone = strdb_get(map->zone_db, newzone)) )
return zone;/* this zone has already been merged */