Resolved some compiler warnings

Fixes #5773

Thanks to @ijped27
This commit is contained in:
Lemongrass3110 2021-03-13 23:07:39 +01:00
parent 47c471e3d0
commit 50c2c400d5

View File

@ -724,8 +724,8 @@ void instance_generate_mapname(int map_id, int instance_id, char outname[MAP_NAM
static const int prefix_length = 4; static const int prefix_length = 4;
// Full map name length - prefix length - seperator character - zero termination // Full map name length - prefix length - seperator character - zero termination
static const int suffix_length = MAP_NAME_LENGTH - prefix_length - 1 - 1; static const int suffix_length = MAP_NAME_LENGTH - prefix_length - 1 - 1;
static const int prefix_limit = pow(10, prefix_length); static const int prefix_limit = static_cast<int>(pow(10, prefix_length));
static const int suffix_limit = pow(10, suffix_length); static const int suffix_limit = static_cast<int>(pow(10, suffix_length));
safesnprintf(outname, MAP_NAME_LENGTH, "%0*u#%0*u", prefix_length, map_id % prefix_limit, suffix_length, instance_id % suffix_limit); safesnprintf(outname, MAP_NAME_LENGTH, "%0*u#%0*u", prefix_length, map_id % prefix_limit, suffix_length, instance_id % suffix_limit);
} }