svn commit: r296540 - vendor/illumos/dist/lib/libzfs/common
Alexander Motin
mav at FreeBSD.org
Tue Mar 8 18:51:13 UTC 2016
Author: mav
Date: Tue Mar 8 18:51:12 2016
New Revision: 296540
URL: https://svnweb.freebsd.org/changeset/base/296540
Log:
4448 zfs diff misprints unicode characters
Reviewed by: Igor Kozhukhov <ikozhukhov at gmail.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Matthew Ahrens <mahrens at delphix.com>
Author: Joshua M. Clulow <jmc at joyent.com>
illumos/illumos-gate at b211eb9181f99c20acbf4c528f94cb44b4ca8c31
Modified:
vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c
Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c
==============================================================================
--- vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Tue Mar 8 18:48:20 2016 (r296539)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Tue Mar 8 18:51:12 2016 (r296540)
@@ -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.
*/
/*
@@ -138,11 +139,14 @@ get_stats_for_obj(differ_info_t *di, con
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);
+ }
}
}
More information about the svn-src-all
mailing list