diff options
author | Denys Vlasenko | 2021-08-23 02:31:26 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-08-23 02:31:26 +0200 |
commit | 1b661122a8bf00e9fb493c8fc144d7822ce05816 (patch) | |
tree | b7e563d11581443a0dd361f8d193f7ceaa2ac8b4 /util-linux | |
parent | dbdf9e0ab1bfe65b75ba20cdf26c8fded2174c60 (diff) | |
download | busybox-1b661122a8bf00e9fb493c8fc144d7822ce05816.zip busybox-1b661122a8bf00e9fb493c8fc144d7822ce05816.tar.gz |
mount: code shrink
function old new delta
append_mount_options 174 157 -17
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mount.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 5bc60de..44afdbc 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -562,9 +562,9 @@ static void append_mount_options(char **oldopts, const char *newopts) // Do not insert options which are already there while (newopts[0]) { char *p; - int len = strlen(newopts); - p = strchr(newopts, ','); - if (p) len = p - newopts; + int len; + + len = strchrnul(newopts, ',') - newopts; p = *oldopts; while (1) { if (!strncmp(p, newopts, len) @@ -579,7 +579,7 @@ static void append_mount_options(char **oldopts, const char *newopts) *oldopts = p; skip: newopts += len; - while (newopts[0] == ',') newopts++; + while (*newopts == ',') newopts++; } } else { if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts); |