summary refs log tree commit diff
path: root/bin/1sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-09 04:35:23 -0400
committerJune McEnroe <june@causal.agency>2020-03-09 20:01:30 -0400
commita75703196f604ac80a7b46bc0d329345407faaf2 (patch)
tree2b70b2b92a22d7b7e5a7de3ef04ee8147a5821fb /bin/1sh
parentReplace eaccess with faccessat (diff)
downloadsrc-a75703196f604ac80a7b46bc0d329345407faaf2.tar.gz
src-a75703196f604ac80a7b46bc0d329345407faaf2.zip
Replace strchrnul with strchr
Diffstat (limited to '')
-rw-r--r--bin/1sh/input.c6
-rw-r--r--bin/1sh/mail.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/bin/1sh/input.c b/bin/1sh/input.c
index f2295a02..d4bc93df 100644
--- a/bin/1sh/input.c
+++ b/bin/1sh/input.c
@@ -224,7 +224,8 @@ again:
 	p = parsefile->buf + (parsenextc - parsefile->buf);
 	end = p + parselleft;
 	*end = '\0';
-	q = strchrnul(p, '\n');
+	q = strchr(p, '\n');
+	if (!q) q = strchr(p, '\0');
 	if (q != end && *q == '\0') {
 		/* delete nul characters */
 		for (r = q; q != end; q++) {
@@ -236,7 +237,8 @@ again:
 			goto again;
 		end = p + parselleft;
 		*end = '\0';
-		q = strchrnul(p, '\n');
+		q = strchr(p, '\n');
+		if (!q) q = strchr(p, '\0');
 	}
 	if (q == end) {
 		parsenleft = parselleft;
diff --git a/bin/1sh/mail.c b/bin/1sh/mail.c
index 8c6b59ae..01b370c6 100644
--- a/bin/1sh/mail.c
+++ b/bin/1sh/mail.c
@@ -87,7 +87,8 @@ chkmail(int silent)
 		p = mpath;
 		if (*p == '\0')
 			break;
-		mpath = strchrnul(mpath, ':');
+		mpath = strchr(p, ':');
+		if (!mpath) mpath = strchr(p, '\0');
 		if (*mpath != '\0') {
 			*mpath++ = '\0';
 			if (p == mpath - 1)