From owner-svn-src-stable@freebsd.org Mon Mar 21 00:27:01 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F4AAAD6702; Mon, 21 Mar 2016 00:27:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 205291350; Mon, 21 Mar 2016 00:27:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L0R037038894; Mon, 21 Mar 2016 00:27:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0R0Ti038893; Mon, 21 Mar 2016 00:27:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210027.u2L0R0Ti038893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297121 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 00:27:01 -0000 Author: mav Date: Mon Mar 21 00:27:00 2016 New Revision: 297121 URL: https://svnweb.freebsd.org/changeset/base/297121 Log: MFC r296541: MFV r296540: 4448 zfs diff misprints unicode characters Reviewed by: Igor Kozhukhov Reviewed by: Toomas Soome Approved by: Matthew Ahrens Author: Joshua M. Clulow illumos/illumos-gate@b211eb9181f99c20acbf4c528f94cb44b4ca8c31 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon Mar 21 00:26:14 2016 (r297120) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon Mar 21 00:27:00 2016 (r297121) @@ -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, 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, "\\%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); } } }