Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d0eec99ce50baa5cc2ac02363cdb2a771ed4e1e2
Commit:     d0eec99ce50baa5cc2ac02363cdb2a771ed4e1e2
Parent:     6454d1f9038f708d7deef6270ed4ba5bb6e55869
Author:     Randy Dunlap <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 28 16:21:46 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Nov 29 09:24:53 2007 -0800

    hexdump: don't print bytes with bit 7 set
    
    As Herbert Xu pointed out, bytes (chars) with bit 7 (0x80) set are true
    with isprint() but they may not be isascii() but be Unicode instead, so
    don't try to print them in hex dumps.
    
    Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
    Cc: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 lib/hexdump.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/hexdump.c b/lib/hexdump.c
index bd5edae..3435465 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -106,7 +106,8 @@ void hex_dump_to_buffer(const void *buf, size_t len, int 
rowsize,
        while (lx < (linebuflen - 1) && lx < (ascii_column - 1))
                linebuf[lx++] = ' ';
        for (j = 0; (j < rowsize) && (j < len) && (lx + 2) < linebuflen; j++)
-               linebuf[lx++] = isprint(ptr[j]) ? ptr[j] : '.';
+               linebuf[lx++] = (isascii(ptr[j]) && isprint(ptr[j])) ? ptr[j]
+                               : '.';
 nil:
        linebuf[lx++] = '\0';
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to