ICO loader: Fix compilation on big endian architectures

Commit ff79901a07 refactors the
ico_read_idir function and removed the local nr variable. Unfortunately,
this variable is still used within an `#ifdef WORDS_BIGENDIAN` block on
big endian architectures as a for loop index variable. As such, the code
does presently not compile since the aforementioned commit. This patch
fixes this issue by re-introducing the variable conditionally on big
endian architectures.

Note: It would likely be cleaner to declare the nr variable as part of
the loop declaration, however, this C99 feature does not seem to be used
anywhere in the code base, hence I refrained from using it here.
This commit is contained in:
Sören Tempel 2022-01-03 10:56:03 +01:00 committed by Kim Woelders
parent 31d6d8532c
commit 7d60151ba9
1 changed files with 3 additions and 0 deletions

View File

@ -139,6 +139,9 @@ ico_read_icon(ico_t * ico, int ino)
{
ie_t *ie;
unsigned int size;
#ifdef WORDS_BIGENDIAN
unsigned int nr;
#endif
ie = &ico->ie[ino];