From aba087b01a90c2cb63e708f81f6867594567c19f Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Tue, 4 Jul 2023 16:45:32 +0200 Subject: [PATCH] !OSDN:#47956:Slawomir Laxh CLang analyzer: remove zer-length-array warning inside savegame3.c diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c index 1ef846627e..a5e2a656e3 100644 --- a/server/savegame/savegame3.c +++ b/server/savegame/savegame3.c @@ -2608,16 +2608,19 @@ static void sg_load_counters(struct loaddata *loading) length = secfile_lookup_int_default(loading->file, 0, "savefile.city_counters_order_size"); - if (length) { - loading->counter.order = secfile_lookup_str_vec(loading->file, &loading->counter.size, "savefile.city_counters_order_vector"); + if (0==length) { - sg_failure_ret(loading->counter.order != 0, + return; + } + + loading->counter.order = secfile_lookup_str_vec(loading->file, &loading->counter.size, "savefile.city_counters_order_vector"); + + sg_failure_ret(loading->counter.order != 0, "Failed to load counter's ruleset order: %s", secfile_error()); - sg_failure_ret(loading->counter.size = length, + sg_failure_ret(loading->counter.size = length, "Counter vector in savegame have bad size: %s", secfile_error()); - } int corder[length]; -- 2.41.0