From 75f6ed0d8f93446d8442cf7bcd97cb36ee956c7a Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 10 Jan 2019 20:05:18 -0500 Subject: Replace strchrnul with strchr --- bin/cash/input.c | 6 ++++-- bin/cash/mail.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'bin/cash') diff --git a/bin/cash/input.c b/bin/cash/input.c index feb782e7..24ba73b5 100644 --- a/bin/cash/input.c +++ b/bin/cash/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/cash/mail.c b/bin/cash/mail.c index 81243b87..6f8a3d39 100644 --- a/bin/cash/mail.c +++ b/bin/cash/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) -- cgit 1.4.1