authorgravatar for shiimizu@protonmail.comshiimizu <shiimizu@protonmail.com> 2019-10-31 10:23:02-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-06 18:22:33-05:00
log7277670843d259d19093c8900b1f8445e41202ae
tree8073b6a5e01397c22b020357bdb093b1dd6c35d1
parentf81f36e2ff348b83ace8ccb4ffd949f3d7c266c9

Add error when too few arguments are provided to std.fmt


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/fmt.zig+4
......@@ -167,6 +167,10 @@ pub fn format(
167167 '}' => {
168168 const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg);
169169
170 if (arg_to_print >= args.len) {
171 @compileError("Too few arguments");
172 }
173
170174 try formatType(
171175 args[arg_to_print],
172176 fmt[0..0],