summary refs log tree commit diff
path: root/src/mail.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mail.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mail.c b/src/mail.c
index 02e07f7..7f9e49d 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -77,9 +77,12 @@ chkmail(void)
 	setstackmark(&smark);
 	mpath = mpathset() ? mpathval() : mailval();
 	for (mtp = mailtime; mtp < mailtime + MAXMBOXES; mtp++) {
-		p = padvance(&mpath, nullstr);
-		if (p == NULL)
+		int len;
+
+		len = padvance(&mpath, nullstr);
+		if (!len)
 			break;
+		p = stackblock();
 		if (*p == '\0')
 			continue;
 		for (q = p ; *q ; q++);