Skip to content

Commit cb94896

Browse files
Make PRINT error on empty call.
1 parent 452c7da commit cb94896

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/builtins.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5779,6 +5779,10 @@ static Value builtin_strip(Interpreter* interp, Value* args, int argc, Expr** ar
57795779
static Value builtin_print(Interpreter* interp, Value* args, int argc, Expr** arg_nodes, Env* env, int line, int col) {
57805780
(void)arg_nodes; (void)env; (void)line; (void)col;
57815781

5782+
if (argc == 0) {
5783+
RUNTIME_ERROR(interp, "PRINT expects at least one argument", line, col);
5784+
}
5785+
57825786
int forward = !(interp && interp->shushed);
57835787

57845788
for (int i = 0; i < argc; i++) {

0 commit comments

Comments
 (0)