diff --git a/src/operators.c b/src/operators.c
index d0869c23e89e3b3e715d867dccaad1adb1075c3a..e5ce15e07656682827a84b19a8473b2fd70e26ad 100644
--- a/src/operators.c
+++ b/src/operators.c
@@ -6,7 +6,7 @@
 /**/
 #include "global.h"
 #include <math.h>
-RCSID("$Id: operators.c,v 1.94 2000/08/03 17:20:28 grubba Exp $");
+RCSID("$Id: operators.c,v 1.95 2000/08/03 17:52:55 grubba Exp $");
 #include "interpret.h"
 #include "svalue.h"
 #include "multiset.h"
@@ -2328,7 +2328,7 @@ PMOD_EXPORT void o_range(void)
   case T_STRING:
   {
     struct pike_string *s;
-    if(to+1>=sp[-1].u.string->len)
+    if(to >= sp[-1].u.string->len-1)
     {
       if(from==0) return;
       to = sp[-1].u.string->len-1;
@@ -2349,7 +2349,7 @@ PMOD_EXPORT void o_range(void)
   case T_ARRAY:
   {
     struct array *a;
-    if(to+1 >= sp[-1].u.array->size)
+    if(to >= sp[-1].u.array->size-1)
     {
       to = sp[-1].u.array->size-1;