mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Properly print characters larger than 127.
Submitted by: noordsij <noordsij@cs.helsinki.fi> Reviewed by: Eric Schrock <eric.schrock@delphix.com> MFC after: 1 month
This commit is contained in:
parent
97b0bfc2e9
commit
939f98dd4d
1 changed files with 4 additions and 2 deletions
|
|
@ -138,8 +138,10 @@ stream_bytes(FILE *fp, const char *string)
|
|||
while (*string) {
|
||||
if (*string > ' ' && *string != '\\' && *string < '\177')
|
||||
(void) fprintf(fp, "%c", *string++);
|
||||
else
|
||||
(void) fprintf(fp, "\\%03o", *string++);
|
||||
else {
|
||||
(void) fprintf(fp, "\\%03hho",
|
||||
(unsigned char)*string++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue