From 893f1d69bf1b0ffd6e4e649e185fb43570b5c316 Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 24 Mar 2011 14:12:41 +0000 Subject: Properly print characters larger than 127. Submitted by: noordsij Reviewed by: Eric Schrock MFC after: 1 month --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cddl') 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++); + } } } -- cgit v1.1