about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 24d515d06..37d63cabe 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2814,12 +2814,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 			zerr("invalid length: %s", check_offset);
 			return NULL;
 		    }
-		    length = mathevali(check_offset);
-		    if (errflag)
-			return NULL;
-		    if (length < (zlong)0) {
-			zerr("invalid length: %s", check_offset);
-			return NULL;
+                    if (check_offset) {
+			length = mathevali(check_offset);
+			if (errflag)
+			    return NULL;
+			if (length < (zlong)0) {
+			    zerr("invalid length: %s", check_offset);
+			    return NULL;
+			}
 		    }
 		}
 		if (horrible_offset_hack) {