Skip to content

Instantly share code, notes, and snippets.

@LemonBoy
Created January 16, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LemonBoy/adf5786e1742203d58c897756752a05a to your computer and use it in GitHub Desktop.
Save LemonBoy/adf5786e1742203d58c897756752a05a to your computer and use it in GitHub Desktop.
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig
index 57fb3a407..1bb3ab611 100644
--- a/lib/std/fmt.zig
+++ b/lib/std/fmt.zig
@@ -431,7 +431,7 @@ pub fn formatType(
},
else => return format(context, Errors, output, "{}@{x}", .{ @typeName(T.Child), @ptrToInt(value) }),
},
- .Many => {
+ .Many, .C => {
if (ptr_info.child == u8) {
if (fmt.len > 0 and fmt[0] == 's') {
const len = mem.len(u8, value);
@@ -449,9 +449,6 @@ pub fn formatType(
}
return format(context, Errors, output, "{}@{x}", .{ @typeName(ptr_info.child), @ptrToInt(value.ptr) });
},
- .C => {
- return format(context, Errors, output, "{}@{x}", .{ @typeName(T.Child), @ptrToInt(value) });
- },
},
.Array => |info| {
const Slice = @Type(builtin.TypeInfo{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment