aboutsummaryrefslogtreecommitdiffstats
path: root/extension/ordchr.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-06-17 20:47:50 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-06-17 20:47:50 +0300
commit5e79fa8735ec2984fee9054cccd51d86fa939621 (patch)
treef4bfe5ed9667c55949f47433917cf8343a450c77 /extension/ordchr.c
parent2c698c5eb4294783e821e986c74e55b63507c790 (diff)
downloadegawk-5e79fa8735ec2984fee9054cccd51d86fa939621.tar.gz
egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.tar.bz2
egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.zip
Still more API and testext.c work.
Diffstat (limited to 'extension/ordchr.c')
-rw-r--r--extension/ordchr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/extension/ordchr.c b/extension/ordchr.c
index dc02479a..ba29d132 100644
--- a/extension/ordchr.c
+++ b/extension/ordchr.c
@@ -30,6 +30,7 @@
*/
#include <stdio.h>
+#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -53,7 +54,9 @@ do_ord(int nargs, awk_value_t *result)
awk_value_t str;
double ret = -1;
- if (do_lint && nargs > 1)
+ assert(result != NULL);
+
+ if (do_lint && nargs > 1)
lintwarn(ext_id, "ord: called with too many arguments");
if (get_argument(0, AWK_STRING, & str)) {
@@ -77,7 +80,9 @@ do_chr(int nargs, awk_value_t *result)
str[0] = str[1] = '\0';
- if (do_lint && nargs > 1)
+ assert(result != NULL);
+
+ if (do_lint && nargs > 1)
lintwarn(ext_id, "chr: called with too many arguments");
if (get_argument(0, AWK_NUMBER, & num)) {