Amiga: fix latent issues found in code review

- fname[18]/sprintf risks overflow for >=10 in any version field;
  switch to snprintf into a wider static buffer.
- (1L << i) for i==31 (or shifting into the depth-loop terminator)
  is undefined for signed long; use 1UL.
- Drop unused cnt= from amii_display_nhwindow's DoMenuScroll call;
  the menu return value is consumed elsewhere, not here.
This commit is contained in:
Ingo Paschke
2026-05-12 15:12:07 +02:00
parent 80a99d1ed1
commit 657f6eaad9
2 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ ReadImageFile(const char *filename, struct BitMap **bmp)
prop = FindProp(iff, ID_BMAP, ID_CMAP);
if (prop) {
unsigned char *cmap = prop->sp_Data;
for (j = 0; j < (1L << np) * 3; j += 3) {
for (j = 0; j < (1UL << np) * 3; j += 3) {
amii_initmap[j / 3] =
amiv_init_map[j / 3] =
((cmap[j+0] >> 4) << 8)