libzfs: diff: stream_bytes: use fputc, %hho formats chars

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Upstream-commit: a72129edcb
Closes #12829
This commit is contained in:
наб 2021-12-09 23:42:02 +01:00 committed by Brian Behlendorf
parent 5a21214be8
commit 7fbb90feea
1 changed files with 2 additions and 2 deletions

View File

@ -122,9 +122,9 @@ stream_bytes(FILE *fp, const char *string)
while ((c = *string++) != '\0') { while ((c = *string++) != '\0') {
if (c > ' ' && c != '\\' && c < '\177') { if (c > ' ' && c != '\\' && c < '\177') {
(void) fprintf(fp, "%c", c); (void) fputc(c, fp);
} else { } else {
(void) fprintf(fp, "\\%04o", (uint8_t)c); (void) fprintf(fp, "\\%04hho", (uint8_t)c);
} }
} }
} }