From a75703196f604ac80a7b46bc0d329345407faaf2 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 9 Mar 2020 04:35:23 -0400 Subject: Replace strchrnul with strchr --- bin/1sh/input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin/1sh/input.c') 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; -- cgit 1.4.1