Merge pull request #1379 from tgschultz/patch-1

fixed handling of [*]u8 when no format specifier is set
This commit is contained in:
Andrew Kelley 2018-08-14 14:38:20 -04:00 committed by GitHub
commit 4c95b2f9d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ pub fn formatType(
},
builtin.TypeInfo.Pointer.Size.Many => {
if (ptr_info.child == u8) {
if (fmt[0] == 's') {
if (fmt.len > 0 and fmt[0] == 's') {
const len = std.cstr.len(value);
return formatText(value[0..len], fmt, context, Errors, output);
}