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:
parent
5a21214be8
commit
7fbb90feea
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue