Skip to content

Commit

Permalink
Squash warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cpq committed Jun 14, 2023
1 parent 3cf8241 commit abef695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions str.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ static char xnibble(char c) {
}

void xhexdump(void (*fn)(char, void *), void *a, const void *buf, size_t len) {
const uint8_t *p = (const uint8_t *) buf;
const unsigned char *p = (const unsigned char *) buf;
char ascii[16];
size_t i, j, n = 0;
for (i = 0; i < len; i++) {
Expand All @@ -670,7 +670,7 @@ void xhexdump(void (*fn)(char, void *), void *a, const void *buf, size_t len) {
fn(xnibble((i >> 4) & 15), a), fn('0', a);
fn(' ', a), fn(' ', a), fn(' ', a);
}
fn(xnibble(p[i] >> 4), a), fn(xnibble(p[i] & 15), a);
fn(xnibble((p[i] >> 4) & 15), a), fn(xnibble(p[i] & 15), a);
fn(' ', a); // Space after hex number
if (p[i] >= ' ' && p[i] <= '~') {
ascii[n++] = (char) p[i]; // Printable
Expand Down

0 comments on commit abef695

Please sign in to comment.