diff options
author | Alexander Motin <mav@FreeBSD.org> | 2016-03-08 18:53:00 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2016-03-08 18:53:00 +0000 |
commit | fe007faa49cdb46d1e538d05069f46152d3f53bc (patch) | |
tree | 959aef1b7201d9976a60204386a34950119f50f7 /cddl | |
parent | 0a688b37cd22bd4c330e077d29f4e76e5291226d (diff) | |
parent | d50309ea89c8e92a35f29ac9187551a116bb4f07 (diff) | |
download | src-fe007faa49cdb46d1e538d05069f46152d3f53bc.tar.gz src-fe007faa49cdb46d1e538d05069f46152d3f53bc.zip |
MFV r296540: 4448 zfs diff misprints unicode characters
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Joshua M. Clulow <jmc@joyent.com>
illumos/illumos-gate@b211eb9181f99c20acbf4c528f94cb44b4ca8c31
Notes
Notes:
svn path=/head/; revision=296541
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c index bb49eba0f835..28b1e2e12e6b 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Joyent, Inc. */ /* @@ -136,12 +137,13 @@ get_stats_for_obj(differ_info_t *di, const char *dsname, uint64_t obj, static void stream_bytes(FILE *fp, const char *string) { - while (*string) { - if (*string > ' ' && *string != '\\' && *string < '\177') - (void) fprintf(fp, "%c", *string++); - else { - (void) fprintf(fp, "\\%03hho", - (unsigned char)*string++); + char c; + + while ((c = *string++) != '\0') { + if (c > ' ' && c != '\\' && c < '\177') { + (void) fprintf(fp, "%c", c); + } else { + (void) fprintf(fp, "\\%03o", (uint8_t)c); } } } |