svn commit: r219959 - head/cddl/contrib/opensolaris/lib/libzfs/common

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Mar 24 14:12:42 UTC 2011


Author: pjd
Date: Thu Mar 24 14:12:41 2011
New Revision: 219959
URL: http://svn.freebsd.org/changeset/base/219959

Log:
  Properly print characters larger than 127.
  
  Submitted by:	noordsij <noordsij at cs.helsinki.fi>
  Reviewed by:	Eric Schrock <eric.schrock at delphix.com>
  MFC after:	1 month

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c	Thu Mar 24 13:52:59 2011	(r219958)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c	Thu Mar 24 14:12:41 2011	(r219959)
@@ -138,8 +138,10 @@ stream_bytes(FILE *fp, const char *strin
 	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++);
+		}
 	}
 }
 


More information about the svn-src-all mailing list