summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-10-08 18:03:00 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-10-08 18:03:00 +0000
commitf00fdfe72537ff8e2547fe22321c50fa9205f5b4 (patch)
treea223223bede07aa8513e719c59f2b14765fa58d8 /bin
parent6620eebd2449744d3d819281b7b2aa74e1ff454c (diff)
Tell user which value of index is out of bounds. ok deraadt@
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/var.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/var.c b/bin/ksh/var.c
index cd58c4b3d40..733f82f2967 100644
--- a/bin/ksh/var.c
+++ b/bin/ksh/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.26 2005/03/30 17:16:37 deraadt Exp $ */
+/* $OpenBSD: var.c,v 1.27 2005/10/08 18:02:59 otto Exp $ */
#include "sh.h"
#include <time.h>
@@ -143,7 +143,7 @@ array_index_calc(const char *n, bool *arrayp, int *valp)
n = str_nsave(n, p - n, ATEMP);
evaluate(sub, &rval, KSH_UNWIND_ERROR, true);
if (rval < 0 || rval > ARRAYMAX)
- errorf("%s: subscript out of range", n);
+ errorf("%s: subscript %ld out of range", n, rval);
*valp = rval;
afree(sub, ATEMP);
}