diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-29 12:55:37 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-29 12:55:37 +0300 |
commit | 33734338e34ed4588ca05cecd5324d5ab5a1a654 (patch) | |
tree | cfd3aac1ec1b6ee41f8fb177ee8a974fa0799065 /extension/ordchr.c | |
parent | 2d0d82f7453b1c5ad5e1baa8c02c2f6d5e5ccb67 (diff) | |
download | egawk-33734338e34ed4588ca05cecd5324d5ab5a1a654.tar.gz egawk-33734338e34ed4588ca05cecd5324d5ab5a1a654.tar.bz2 egawk-33734338e34ed4588ca05cecd5324d5ab5a1a654.zip |
Minor improvements in doc and in ordchr.c.
Diffstat (limited to 'extension/ordchr.c')
-rw-r--r-- | extension/ordchr.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/extension/ordchr.c b/extension/ordchr.c index ba29d132..8d7eac8f 100644 --- a/extension/ordchr.c +++ b/extension/ordchr.c @@ -61,8 +61,12 @@ do_ord(int nargs, awk_value_t *result) if (get_argument(0, AWK_STRING, & str)) { ret = str.str_value.str[0]; - } else if (do_lint) - lintwarn(ext_id, "ord: called with no arguments"); + } else if (do_lint) { + if (nargs == 0) + lintwarn(ext_id, "ord: called with no arguments"); + else + lintwarn(ext_id, "ord: called with inappropriate argument(s)"); + } /* Set the return value */ return make_number(ret, result); @@ -91,8 +95,12 @@ do_chr(int nargs, awk_value_t *result) ret &= 0xff; str[0] = ret; str[1] = '\0'; - } else if (do_lint) - lintwarn(ext_id, "chr: called with no arguments"); + } else if (do_lint) { + if (nargs == 0) + lintwarn(ext_id, "chr: called with no arguments"); + else + lintwarn(ext_id, "chr: called with inappropriate argument(s)"); + } /* Set the return value */ return dup_string(str, 1, result); |