aboutsummaryrefslogtreecommitdiffstats
path: root/ramap.c
diff options
context:
space:
mode:
Diffstat (limited to 'ramap.c')
-rw-r--r--ramap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ramap.c b/ramap.c
index b869ff6..25a1df9 100644
--- a/ramap.c
+++ b/ramap.c
@@ -1465,6 +1465,8 @@ SCM array_imap(ra, proc)
SCM inds = make_uve(ARRAY_NDIM(ra)+0L, MAKINUM(-1L));
long *vinds = VELTS(inds);
int j, k, kmax = ARRAY_NDIM(ra) - 1;
+ if (kmax < 0)
+ return aset(ra, apply(proc, EOL, EOL), EOL);
for (k = 0; k <= kmax; k++)
vinds[k] = ARRAY_DIMS(ra)[k].lbnd;
k = kmax;