From 939f98dd4da1e08f2274ceff7092405bd2254544 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 24 Mar 2011 14:12:41 +0000 Subject: [PATCH] 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(-) diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c index ae84285a9bb..ab2007d98a3 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++); + } } }