summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index 26b3f3133..1cff358df 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1565,8 +1565,11 @@ getstrvalue(Value v)
     if (v->start == 0 && v->end == -1)
 	return s;
 
-    if (v->start < 0)
+    if (v->start < 0) {
 	v->start += strlen(s);
+	if (v->start < 0)
+	    v->start = 0;
+    }
     if (v->end < 0)
 	v->end += strlen(s) + 1;
     s = (v->start > (int)strlen(s)) ? dupstring("") : dupstring(s + v->start);