Skip to content

Commit

Permalink
libzfs: diff: stream_bytes: use fputc, %hho formats chars
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rich Ercolani <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Upstream-commit: a72129e
Closes openzfs#12829
  • Loading branch information
nabijaczleweli authored and behlendorf committed Apr 1, 2022
1 parent 5a21214 commit 7fbb90f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/libzfs/libzfs_diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ stream_bytes(FILE *fp, const char *string)

while ((c = *string++) != '\0') {
if (c > ' ' && c != '\\' && c < '\177') {
(void) fprintf(fp, "%c", c);
(void) fputc(c, fp);
} else {
(void) fprintf(fp, "\\%04o", (uint8_t)c);
(void) fprintf(fp, "\\%04hho", (uint8_t)c);
}
}
}
Expand Down

0 comments on commit 7fbb90f

Please sign in to comment.