diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh index 889fe0d..e9ab384 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh @@ -393,5 +393,13 @@ sleep 1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +n=`expr $n + 1` +echo "I:check 'rndc \"\"' is handled ($n)" +ret=0 +$RNDCCMD "" > rndc.out.test$n 2>&1 && ret=1 +grep "rndc: '' failed: failure" rndc.out.test$n > /dev/null +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + echo "I:exit status: $status" exit $status diff --git a/lib/isc/include/isc/lex.h b/lib/isc/include/isc/lex.h index 8612150..81af3af 100644 --- a/lib/isc/include/isc/lex.h +++ b/lib/isc/include/isc/lex.h @@ -152,8 +152,6 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp); * Requires: *\li '*lexp' is a valid lexer. * - *\li max_token > 0. - * * Ensures: *\li On success, *lexp is attached to the newly created lexer. * diff --git a/lib/isc/lex.c b/lib/isc/lex.c index ce1c559..fa6e03f 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -94,9 +94,10 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) { /* * Create a lexer. */ - REQUIRE(lexp != NULL && *lexp == NULL); - REQUIRE(max_token > 0U); + + if (max_token == 0U) + max_token = 1; lex = isc_mem_get(mctx, sizeof(*lex)); if (lex == NULL)