Skip to content

Commit

Permalink
Fix write option max_depth checking, re issue #250
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Jul 10, 2023
1 parent 6a44340 commit 38ca5d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -2483,8 +2483,10 @@ bool parse_write_params(query *q, cell *c, pl_idx c_ctx, cell **vnames, pl_idx *
return false;
}

if (is_integer(c1) && (get_smallint(&c[1]) >= 1))
if (is_integer(c1) && (get_smallint(&c[1]) >= 0))
q->max_depth = get_smallint(&c[1]);
else
throw_error(q, c, c_ctx, "domain_error", "write_option");
} else if (!CMP_STR_TO_CSTR(q, c, "fullstop")) {
if (is_var(c1)) {
throw_error(q, c1, c_ctx, "instantiation_error", "write_option");
Expand Down

0 comments on commit 38ca5d4

Please sign in to comment.