Project

General

Profile

Bug #773 » 0003-Fix-clang-20-compiler-warnings.patch

S2_6 - Marko Lindqvist, 08/05/2024 09:27 PM

View differences:

client/tilespec.c
static void tileset_setup_road(struct tileset *t,
struct extra_type *pextra)
{
char full_tag_name[MAX_LEN_NAME + strlen("_isolated")];
char full_alt_name[MAX_LEN_NAME + strlen("_isolated")];
char full_tag_name[MAX_LEN_NAME + sizeof("_isolated")];
char full_alt_name[MAX_LEN_NAME + sizeof("_isolated")];
const int id = extra_index(pextra);
int i;
enum extrastyle_id extrastyle = t->sprites.extras[id].extrastyle;
......
static void tileset_setup_base(struct tileset *t,
const struct extra_type *pextra)
{
char full_tag_name[MAX_LEN_NAME + strlen("_fg")];
char full_tag_name[MAX_LEN_NAME + sizeof("_fg")];
const int id = extra_index(pextra);
fc_assert_ret(id >= 0 && id < extra_count());
server/report.c
/* Must be big enough to contain any string there might be in "addplayer" line
* to read.
* Could have even strlen("addplayer 0 0 "), but maintenance not worth
* Could have even sizeof("addplayer 0 0 ") - 1, but maintenance not worth
* saving couple of bytes. */
char plr_name[MAX(MAX_LEN_NAME, MAX_SCORELOG_LINE_LEN - strlen("addplayer "))];
char plr_name[MAX(MAX_LEN_NAME, MAX_SCORELOG_LINE_LEN - (sizeof("addplayer ") - 1)) + 1];
fc_assert_ret_val(score_log != NULL, FALSE);
fc_assert_ret_val(score_log->fp != NULL, FALSE);
(3-3/3)