diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-17 20:47:50 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-17 20:47:50 +0300 |
commit | 5e79fa8735ec2984fee9054cccd51d86fa939621 (patch) | |
tree | f4bfe5ed9667c55949f47433917cf8343a450c77 /extension/time.c | |
parent | 2c698c5eb4294783e821e986c74e55b63507c790 (diff) | |
download | egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.tar.gz egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.tar.bz2 egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.zip |
Still more API and testext.c work.
Diffstat (limited to 'extension/time.c')
-rw-r--r-- | extension/time.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extension/time.c b/extension/time.c index ba8578c3..2024510c 100644 --- a/extension/time.c +++ b/extension/time.c @@ -26,6 +26,7 @@ */ #include <stdio.h> +#include <assert.h> #include <errno.h> #include <stdlib.h> #include <string.h> @@ -61,7 +62,9 @@ do_gettimeofday(int nargs, awk_value_t *result) { double curtime; - if (do_lint && nargs > 0) + assert(result != NULL); + + if (do_lint && nargs > 0) lintwarn(ext_id, "gettimeofday: ignoring arguments"); #if defined(HAVE_GETTIMEOFDAY) @@ -111,7 +114,9 @@ do_sleep(int nargs, awk_value_t *result) double secs; int rc; - if (do_lint && nargs > 1) + assert(result != NULL); + + if (do_lint && nargs > 1) lintwarn(ext_id, "sleep: called with too many arguments"); if (! get_argument(0, AWK_NUMBER, &num)) { |