aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/archetype/array.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/archetype/array.cpp')
-rw-r--r--engines/glk/archetype/array.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/glk/archetype/array.cpp b/engines/glk/archetype/array.cpp
index 79a486faf1..33147d1a9a 100644
--- a/engines/glk/archetype/array.cpp
+++ b/engines/glk/archetype/array.cpp
@@ -38,7 +38,10 @@ void append_to_xarray(XArrayType &the_xarray, void *element) {
}
bool access_xarray(XArrayType &the_xarray, int index, void *&result, AccessType direction) {
- if (index < 1 || index > (int)the_xarray.size())
+ if (index <= 0)
+ error("Invalid index - double check arrays were 1 based in original");
+
+ if (index > (int)the_xarray.size())
return false;
switch (direction) {