diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-06-28 07:19:33 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-28 14:50:03 +0200 |
commit | 5eb71097bf476954a0da4279b496997ae27e60fa (patch) | |
tree | 46f7aa3f301d2b009bac1e1ed8487bbd7e843a45 /commands/hwclock.c | |
parent | 45bad4394d50034a8cd157b0f01d2807a5dab372 (diff) | |
download | barebox-5eb71097bf476954a0da4279b496997ae27e60fa.tar.gz barebox-5eb71097bf476954a0da4279b496997ae27e60fa.tar.xz |
string: implement strchrnul
We have at least two places opencoding strchrnul, one of them needlessly
iterating twice instead of once over the string. Replace both by calling
a common single pass implementation.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210628051934.9604-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/hwclock.c')
-rw-r--r-- | commands/hwclock.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/commands/hwclock.c b/commands/hwclock.c index 1b5c2cd100..7a5600c456 100644 --- a/commands/hwclock.c +++ b/commands/hwclock.c @@ -9,14 +9,6 @@ #include <string.h> #include <environment.h> -static char *strchrnul(const char *s, int c) -{ - while (*s != '\0' && *s != c) - s++; - - return (char *)s; -} - static int sscanf_two_digits(char *s, int *res) { char buf[3]; |