Skip to content

Commit

Permalink
4448 zfs diff misprints unicode characters
Browse files Browse the repository at this point in the history
Reviewed by: Igor Kozhukhov <[email protected]>
Reviewed by: Toomas Soome <[email protected]>
Approved by: Matthew Ahrens <[email protected]>
  • Loading branch information
jclulow authored and rmustacc committed Jan 30, 2016
1 parent 1a3a6de commit b211eb9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions usr/src/lib/libzfs/common/libzfs_diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

/*
Expand Down Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit b211eb9

Please sign in to comment.