mirror of
https://github.com/opnsense/src.git
synced 2026-03-31 06:55:18 -04:00
Ensure that zfs diff prints unicode safely.
In the stream_bytes() library function used by `zfs diff`, explicitly cast each byte in the input string to an unsigned character so that the Linux fprintf() correctly escapes to octal and does not mangle the output. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1172
This commit is contained in:
parent
b077fd4c4e
commit
38145d6129
1 changed files with 1 additions and 1 deletions
|
|
@ -141,7 +141,7 @@ stream_bytes(FILE *fp, const char *string)
|
|||
if (*string > ' ' && *string != '\\' && *string < '\177')
|
||||
(void) fprintf(fp, "%c", *string++);
|
||||
else
|
||||
(void) fprintf(fp, "\\%03o", *string++);
|
||||
(void) fprintf(fp, "\\%03o", (unsigned char)*string++);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue