Skip to content

Commit

Permalink
Fix compile warning about format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
skbeh committed Jun 23, 2022
1 parent eec9367 commit 183d2e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pigs.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ void print_result(int sock, int rv, cmdCmd_t cmd)
{
ch = response_buf[i];

if (printFlags & PRINT_HEX) printf(" %hhx", ch);
if (printFlags & PRINT_HEX) printf(" %x", ch);

else if (printFlags & PRINT_ASCII)
{
if (isprint(ch) || (ch == '\n') || (ch == '\r'))
printf("%c", ch);
else printf("\\x%02hhx", ch);
else printf("\\x%02x", ch);
}
else printf(" %hhu", response_buf[i]);
}
Expand Down Expand Up @@ -249,13 +249,13 @@ void print_result(int sock, int rv, cmdCmd_t cmd)
{
ch = response_buf[i];

if (printFlags & PRINT_HEX) printf(" %hhx", ch);
if (printFlags & PRINT_HEX) printf(" %x", ch);

else if (printFlags & PRINT_ASCII)
{
if (isprint(ch) || (ch == '\n') || (ch == '\r'))
printf("%c", ch);
else printf("\\x%02hhx", ch);
else printf("\\x%02x", ch);
}
else printf(" %hhu", response_buf[i]);
}
Expand Down

0 comments on commit 183d2e8

Please sign in to comment.