mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 00:35:10 +00:00
Add error when too few arguments are provided to std.fmt
This commit is contained in:
parent
f81f36e2ff
commit
7277670843
@ -167,6 +167,10 @@ pub fn format(
|
||||
'}' => {
|
||||
const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg);
|
||||
|
||||
if (arg_to_print >= args.len) {
|
||||
@compileError("Too few arguments");
|
||||
}
|
||||
|
||||
try formatType(
|
||||
args[arg_to_print],
|
||||
fmt[0..0],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user