aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Pawel Stefaniak <pstef@FreeBSD.org>2021-04-01 05:31:03 +0000
committerPiotr Pawel Stefaniak <pstef@FreeBSD.org>2021-04-01 05:31:03 +0000
commit5a18515b3143792135881ce64e2380115c4744c1 (patch)
tree178a2c109fb1b8c8ea00360a6f535f7355d56e05
parent556e66b7b0763d36ddf5af98d06a1a13090bb729 (diff)
downloadsrc-5a18515b3143792135881ce64e2380115c4744c1.tar.gz
src-5a18515b3143792135881ce64e2380115c4744c1.zip
-rw-r--r--bin/sh/memalloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c
index a2191771386d..7ea31af050e5 100644
--- a/bin/sh/memalloc.c
+++ b/bin/sh/memalloc.c
@@ -227,7 +227,10 @@ popstackmark(struct stackmark *mark)
}
stacknxt = mark->stacknxt;
stacknleft = mark->stacknleft;
- sstrend = stacknxt + stacknleft;
+ if (stacknleft != 0)
+ sstrend = stacknxt + stacknleft;
+ else
+ sstrend = stacknxt;
INTON;
}