aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-08-14 14:38:20 -0400
committerGitHub <noreply@github.com>2018-08-14 14:38:20 -0400
commit4c95b2f9d1c6fd020c484fef53f796448203fb12 (patch)
tree40121670ba4c0ad573029ed678fda0415d0aaede /std
parent52471f6221c76f47b0661754511b3559e60fd801 (diff)
parentfa955f0024bc1e63200f6c6e3d22cf88dc6a65a5 (diff)
downloadzig-4c95b2f9d1c6fd020c484fef53f796448203fb12.tar.gz
zig-4c95b2f9d1c6fd020c484fef53f796448203fb12.zip
Merge pull request #1379 from tgschultz/patch-1
fixed handling of [*]u8 when no format specifier is set
Diffstat (limited to 'std')
-rw-r--r--std/fmt/index.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/std/fmt/index.zig b/std/fmt/index.zig
index f4f9efee37..a9ae979323 100644
--- a/std/fmt/index.zig
+++ b/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);
}