summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-03-24 14:12:41 +0000
committerpjd <pjd@FreeBSD.org>2011-03-24 14:12:41 +0000
commit893f1d69bf1b0ffd6e4e649e185fb43570b5c316 (patch)
tree4428327a408d8666b8eb22d61183ecfac5d6083c /cddl
parentc8811aa539115115a01e70e1b88b4605210a1804 (diff)
downloadFreeBSD-src-893f1d69bf1b0ffd6e4e649e185fb43570b5c316.zip
FreeBSD-src-893f1d69bf1b0ffd6e4e649e185fb43570b5c316.tar.gz
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
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
index ae84285..ab2007d 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
@@ -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++);
+ }
}
}
OpenPOWER on IntegriCloud