Skip to content

Commit 87c1f9a

Browse files
nvlsianpunashif
authored andcommitted
stats: fixed implicit integer sign extension in stats_get_off()
Introduced explicit casting for fixing static analyze issue. fixes #39812 Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent ec576a5 commit 87c1f9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/stats/stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ stats_get_name(const struct stats_hdr *hdr, int idx)
4343
static uint16_t
4444
stats_get_off(const struct stats_hdr *hdr, int idx)
4545
{
46-
return sizeof(*hdr) + idx * hdr->s_size;
46+
return (uint16_t) (sizeof(*hdr) + idx * (int) hdr->s_size);
4747
}
4848

4949
/**

0 commit comments

Comments
 (0)