Project

General

Profile

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

main, S3_2 - Marko Lindqvist, 08/05/2024 07:56 AM

View differences:

client/gui-gtk-3.22/menu.c
const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
if (path == NULL) {
char buf[MAX_LEN_NAME + strlen("<MENU>/GOTO_AND/")];
char buf[MAX_LEN_NAME + sizeof("<MENU>/GOTO_AND/")];
fc_snprintf(buf, sizeof(buf), "<MENU>/GOTO_AND/%s",
action_id_rule_name(act_id));
client/tilespec.c
struct extra_type *pextra,
const char *tag)
{
char full_tag_name[MAX_LEN_NAME + strlen("_isolated")];
char full_tag_name[MAX_LEN_NAME + sizeof("_isolated")];
const int id = extra_index(pextra);
int i;
enum extrastyle_id extrastyle = t->sprites.extras[id].extrastyle;
......
const struct extra_type *pextra,
const char *tag)
{
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);
(1-1/3)