mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-08 13:20:35 +00:00
lib: zlog_hexdump actually output printable ascii characters
We are getting this output from zlog_hexdump: 0x00007fffdd1f9648: 45 00 00 94 ee 63 40 00 45....6340. 0x00007fffdd1f9650: 03 00 ff 0a 14 00 0f fd ........ 0x00007fffdd1f9658: e8 01 01 01 45 00 00 80 ....45... 0x00007fffdd1f9660: ee 63 40 00 0a 11 75 0a .6340...75. 0x00007fffdd1f9668: 14 00 0f fd e8 01 01 01 ........ 0x00007fffdd1f9670: 10 e1 10 e1 00 6c d0 54 .....6c.54 0x00007fffdd1f9678: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f9680: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f9688: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f9690: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f9698: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96a0: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96a8: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96b0: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96b8: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96c0: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96c8: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96d0: 00 00 00 00 00 00 00 00 ........ 0x00007fffdd1f96d8: 00 00 00 00 .... As you can see the ascii dump on the right is wrong and not lined up correctly. This commit fixes this issue: 0x00007ffcf046f228: 45 00 00 58 c6 36 40 00 E..X.6@. 0x00007ffcf046f230: 03 00 ff 73 14 00 0f fd ...s.... 0x00007ffcf046f238: e8 01 01 01 45 00 00 44 ....E..D 0x00007ffcf046f240: c6 36 40 00 0a 11 9d 73 .6@....s 0x00007ffcf046f248: 14 00 0f fd e8 01 01 01 ........ 0x00007ffcf046f250: 10 e1 10 e1 00 30 d0 cc .....0.. 0x00007ffcf046f258: 00 00 00 00 00 00 00 00 ........ 0x00007ffcf046f260: 00 00 00 00 00 00 00 00 ........ 0x00007ffcf046f268: 00 00 00 00 00 00 00 00 ........ 0x00007ffcf046f270: 00 00 00 00 00 00 00 00 ........ 0x00007ffcf046f278: 00 00 00 00 00 00 00 00 ........ Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
a93c2f63ee
commit
a9019bda5c
@ -1022,7 +1022,7 @@ zlog_hexdump (void *mem, unsigned int len) {
|
||||
s += sprintf(s, " ");
|
||||
|
||||
else if(isprint(((char*)mem)[j])) /* printable char */
|
||||
s += sprintf(s, "%x", 0xFF & ((char*)mem)[j]);
|
||||
s += sprintf(s, "%c", 0xFF & ((char*)mem)[j]);
|
||||
|
||||
else /* other char */
|
||||
s += sprintf(s, ".");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user