Changeset 3621 for trunk

Show
Ignore:
Timestamp:
09/30/08 08:13:54 (3 months ago)
Author:
stuge
Message:

Do not try to display non-printable characters on the bootlog and
ramdump screens. This fixes unaligned display on serial console.

The current isprint() implementation assumes a C locale, so also
characters with the eigth bit set are supressed (they produced
inconsistant results on VGA and serial anyway).

Signed-off-by: Ulf Jordan <jordan@…>
Acked-by: Peter Stuge <peter@…>

Location:
trunk/payloads/coreinfo
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/payloads/coreinfo/bootlog_module.c

    r3247 r3621  
    6464        /* FIXME: Handle lines longer than 80 characters. */ 
    6565        while (y <= 18) { 
    66                 mvwaddnstr(win, y + 2, x, tmp, 1); 
     66                mvwaddch(win, y + 2, x, isprint(*tmp) ? *tmp : ' '); 
    6767                x++; 
    6868                tmp++; 
  • trunk/payloads/coreinfo/ramdump_module.c

    r3492 r3621  
    4545                } 
    4646                mvwprintw(win, row + y, col + x + 9, "%02x", ptr[i - 1]); 
    47                 mvwprintw(win, row + y, 62 + count++, "%c", ptr[i - 1]); 
     47                mvwprintw(win, row + y, 62 + count++, "%c", 
     48                          isprint(ptr[i - 1]) ? ptr[i - 1] : ' '); 
    4849                x += 3; 
    4950                if (x == 24)    /* One more space after column/byte 8. */