aboutsummaryrefslogtreecommitdiffstats
path: root/extension/rwarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'extension/rwarray.c')
-rw-r--r--extension/rwarray.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 3c629579..fed040fc 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -82,12 +82,12 @@ do_writea(int nargs)
uint32_t major = MAJOR;
uint32_t minor = MINOR;
- if (do_lint && get_curfunc_arg_count() > 2)
+ if (do_lint && nargs > 2)
lintwarn("writea: called with too many arguments");
/* directory is first arg, array to dump is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
+ file = get_scalar_argument(0, false);
+ array = get_array_argument(1, false);
/* open the file, if error, set ERRNO and return */
(void) force_string(file);
@@ -115,7 +115,7 @@ do_writea(int nargs)
done1:
ret = -1;
- update_ERRNO();
+ update_ERRNO_int(errno);
unlink(file->stptr);
done0:
@@ -250,12 +250,12 @@ do_reada(int nargs)
uint32_t minor;
char magic_buf[30];
- if (do_lint && get_curfunc_arg_count() > 2)
+ if (do_lint && nargs > 2)
lintwarn("reada: called with too many arguments");
/* directory is first arg, array to dump is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
+ file = get_scalar_argument(0, false);
+ array = get_array_argument(1, false);
(void) force_string(file);
fd = open(file->stptr, O_RDONLY);
@@ -289,7 +289,7 @@ do_reada(int nargs)
goto done1;
}
- assoc_clear(array);
+ assoc_clear(array, NULL);
ret = read_array(fd, array);
if (ret == 0)
@@ -297,7 +297,7 @@ do_reada(int nargs)
done1:
ret = -1;
- update_ERRNO();
+ update_ERRNO_int(errno);
done0:
close(fd);