fix: isprint => canprint

add a canprint() func that return true iif
char is ascii (< 0x80) and not a control char
(> 0x1F), as isprint() seems to be different
under Linux and Windows
This commit is contained in:
Stéphane Lesimple
2020-08-25 13:03:05 +02:00
parent 5ab5f9b0cb
commit 5553ed332f
9 changed files with 65 additions and 18 deletions

View File

@@ -623,7 +623,7 @@ static void render_sector(raw_editor_context *rec)
gdk_gc_set_rgb_fg_color(Closure->drawGC,Closure->foreground);
sprintf(byte, "%c", isprint(buf[idx]) ? buf[idx] : '.');
sprintf(byte, "%c", canprint(buf[idx]) ? buf[idx] : '.');
idx++;
SetText(rec->layout, byte, &w, &h);
gdk_draw_layout(d, Closure->drawGC, x, y, rec->layout);