| ... | @@ -167,6 +167,10 @@ pub fn format( | ... | @@ -167,6 +167,10 @@ pub fn format( |
| 167 | '}' => { | 167 | '}' => { |
| 168 | const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); | 168 | const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); |
| 169 | | 169 | |
| | 170 | if (arg_to_print >= args.len) { |
| | 171 | @compileError("Too few arguments"); |
| | 172 | } |
| | 173 | |
| 170 | try formatType( | 174 | try formatType( |
| 171 | args[arg_to_print], | 175 | args[arg_to_print], |
| 172 | fmt[0..0], | 176 | fmt[0..0], |