pixma: print characters @ pixma_hexdump()

merge-requests/213/head^2
Rolf Bensch 2020-03-11 23:55:21 +01:00
rodzic e58641a430
commit 05459de5e8
1 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -48,6 +48,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <math.h> /* pow(C90) */
#include <sys/time.h> /* gettimeofday(4.3BSD) */
@ -143,6 +144,24 @@ pixma_hexdump (int level, const void *d_, unsigned len)
p++;
}
}
for (c = 0; c < 4; c++)
{
p[0] = ' ';
p++;
}
for (c = 0; c != 16 && (ofs + c) < plen; c++)
{
if (isprint(d[ofs + c]))
p[0] = d[ofs + c];
else
p[0] = '.';
p++;
if (c == 7)
{
p[0] = ' ';
p++;
}
}
p[0] = '\0';
pixma_dbg (level, "%s\n", line);
ofs += c;