Commit fa955f0024
Changed files (1)
std
fmt
std/fmt/index.zig
@@ -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);
}