static analyzer bit in mklev.c

src/mklev.c(137): warning: Using uninitialized memory 'ri'.

There was a for-loop assigning values to some elements of
ri[], but not all of them.

Initialize the array.
This commit is contained in:
nhmall
2023-12-22 22:02:18 -05:00
parent 4bc5e26082
commit d123cd77d1

View File

@@ -120,7 +120,7 @@ void
sort_rooms(void)
{
coordxy x, y;
unsigned i, ri[MAXNROFROOMS + 1], n = (unsigned) gn.nroom;
unsigned i, ri[MAXNROFROOMS + 1] = { 0U }, n = (unsigned) gn.nroom;
qsort((genericptr_t) gr.rooms, n, sizeof (struct mkroom), mkroom_cmp);