cmenu: use putchar instead of putch when using default attribute
authorPierre-Alexandre Meyer <pierre@mouraf.org>
Thu, 3 Sep 2009 22:23:22 +0000 (15:23 -0700)
committerPierre-Alexandre Meyer <pierre@mouraf.org>
Thu, 3 Sep 2009 22:23:22 +0000 (15:23 -0700)
There is no real need to do putch('x', 0x07), 0x07 being the default
VGA attribute. Use putchar instead.

Note that showhelp will trigger a drawbox first with 0x07 as attribute.
Since we don't update the attribute, it is guaranteed to still be 0x07
when invoking putch.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
com32/cmenu/libmenu/help.c

index 22f6f3d..5306aa9 100644 (file)
@@ -126,14 +126,14 @@ void showhelp(const char *filename)
        printtext(text, curr_line);
        gotoxy(HELP_BODY_ROW - 1, nc - HELP_RIGHT_MARGIN);
        if (curr_line > 0)
-           putch(HELP_MORE_ABOVE, 0x07);
+           putchar(HELP_MORE_ABOVE);
        else
-           putch(' ', 0x07);
+           putchar(' ');
        gotoxy(nr - HELP_BOTTOM_MARGIN + 1, nc - HELP_RIGHT_MARGIN);
        if (curr_line < numlines - ph)
-           putch(HELP_MORE_BELOW, 0x07);
+           putchar(HELP_MORE_BELOW);
        else
-           putch(' ', 0x07);
+           putchar(' ');
 
        inputc(&scan);          // wait for user keypress