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>
Closes #12829
This commit is contained in:
наб 2021-12-09 23:42:02 +01:00 committed by Brian Behlendorf
parent 1cfb6ef36e
commit a72129edcb

View File

@ -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);
}
}
}