]> www.infradead.org Git - mtd-utils.git/commitdiff
nanddump: Fix hexdump nybble ordering
authorJon Povey <jon.povey@racelogic.co.uk>
Fri, 20 Aug 2010 08:11:19 +0000 (17:11 +0900)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 30 Aug 2010 10:38:59 +0000 (13:38 +0300)
Hex dumps were being printed with the nybbles reversed since
commit 6ff458433ba15b8a7cb258ce64e64e98982df26e
Fix.

Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
CC: Brian Norris <norris@broadcom.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
nanddump.c

index acfdb331f1cc0fce0c2b47738f2fc191343492a7..22fec5fe89180cce4b71b914c0fdbcb1e23ef4db 100644 (file)
@@ -239,8 +239,8 @@ static void pretty_dump_to_buffer(const unsigned char *buf, size_t len,
 
        for (j = 0; (j < len) && (lx + 3) <= linebuflen; j++) {
                ch = buf[j];
-               linebuf[lx++] = hex_asc[ch & 0x0f];
                linebuf[lx++] = hex_asc[(ch & 0xf0) >> 4];
+               linebuf[lx++] = hex_asc[ch & 0x0f];
                linebuf[lx++] = ' ';
        }
        if (j)