diff options
| author | Joshua M. Clulow <jmc@joyent.com> | 2016-01-28 18:54:15 -0800 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2016-01-29 17:54:34 -0800 |
| commit | b211eb9181f99c20acbf4c528f94cb44b4ca8c31 (patch) | |
| tree | 97828f92e916c1c79f6c213948071fe38a16aa37 | |
| parent | 1a3a6dee3c970f347783cae39e1f3536e3116a96 (diff) | |
| download | illumos-joyent-b211eb9181f99c20acbf4c528f94cb44b4ca8c31.tar.gz | |
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>
| -rw-r--r-- | usr/src/lib/libzfs/common/libzfs_diff.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_diff.c b/usr/src/lib/libzfs/common/libzfs_diff.c index 716a101d46..57ef6aef33 100644 --- a/usr/src/lib/libzfs/common/libzfs_diff.c +++ b/usr/src/lib/libzfs/common/libzfs_diff.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. - * Copyright 2015 Joyent, Inc. + * Copyright 2016 Joyent, Inc. */ /* @@ -130,11 +130,14 @@ 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, "\\%03o", *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); + } } } |
