Amiga: tighten two minor issues from review
- amii_set_text_font called CloseLibrary(DiskfontBase) outside the OpenLibrary guard; on Kickstart V36+ that is a no-op for a NULL handle, but on V33/V34 it is undefined. Move the close inside the if-block where DiskfontBase is known non-NULL. - amii_get_ext_cmd's bounds check used BUFSZ for an obufp[100] buffer; the tighter COLNO check actually bounded it but the expression was misleading. Use sizeof obufp.
This commit is contained in:
+2
-1
@@ -499,7 +499,8 @@ amii_get_ext_cmd(void)
|
||||
sel = com_index;
|
||||
} else {
|
||||
colx = put_ext_cmd(obufp, colx, cw, bottom);
|
||||
if (bufp - obufp < BUFSZ - 1 && bufp - obufp < COLNO)
|
||||
if (bufp - obufp < (int) sizeof obufp - 1
|
||||
&& bufp - obufp < COLNO)
|
||||
bufp++;
|
||||
}
|
||||
} else if (c == ('X' - 64) || c == '\177') {
|
||||
|
||||
Reference in New Issue
Block a user