From f8ea34489f15e909e552d83ec6c7b5119dc33c33 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 15:29:32 +0200 Subject: [PATCH] Amiga: fix three latent bugs found in code review amiv_lprint_glyph used uninitialized 'base'; amii_clear_nhwindow compared cw->type to a winid; amii_sethipens fell through. --- sys/amiga/winchar.c | 2 +- sys/amiga/winfuncs.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 0c9dbc6b2..1b62c390f 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -563,7 +563,7 @@ amiv_flush_glyph_buffer(struct Window *vw) void amiv_lprint_glyph(winid window, int color_index, int glyph) { - int base; + int base = 0; struct amii_WinDesc *cw; struct Window *w; int curx; diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index db32e2e8b..788964b77 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1354,6 +1354,7 @@ amii_sethipens(struct Window *w, int type, int attr) case NHW_TEXT: SetAPen(w->RPort, attr ? C_BLACK : amii_textAPen); SetBPen(w->RPort, amii_textBPen); + break; case -2: SetBPen(w->RPort, amii_otherBPen); SetAPen(w->RPort, attr ? C_RED : amii_otherAPen); @@ -1445,7 +1446,7 @@ amii_clear_nhwindow(winid win) /* Clear the overview window too if it is displayed */ if (WINVERS_AMIV - && (cw->type == WIN_MAP && WIN_OVER != WIN_ERR && reclip == 0)) { + && (cw->type == NHW_MAP && WIN_OVER != WIN_ERR && reclip == 0)) { amii_clear_nhwindow(WIN_OVER); }