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:
Pawel Jakub Dawidek 2011-03-24 14:12:41 +00:00
parent 97b0bfc2e9
commit 939f98dd4d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219959

View File

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