diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-08-23 02:31:26 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-08-23 02:31:26 +0200 |
commit | 1b661122a8bf00e9fb493c8fc144d7822ce05816 (patch) | |
tree | b7e563d11581443a0dd361f8d193f7ceaa2ac8b4 /util-linux | |
parent | dbdf9e0ab1bfe65b75ba20cdf26c8fded2174c60 (diff) | |
download | busybox-w32-1b661122a8bf00e9fb493c8fc144d7822ce05816.tar.gz busybox-w32-1b661122a8bf00e9fb493c8fc144d7822ce05816.tar.bz2 busybox-w32-1b661122a8bf00e9fb493c8fc144d7822ce05816.zip |
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 5bc60de59..44afdbcff 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) | |||
562 | // Do not insert options which are already there | 562 | // Do not insert options which are already there |
563 | while (newopts[0]) { | 563 | while (newopts[0]) { |
564 | char *p; | 564 | char *p; |
565 | int len = strlen(newopts); | 565 | int len; |
566 | p = strchr(newopts, ','); | 566 | |
567 | if (p) len = p - newopts; | 567 | len = strchrnul(newopts, ',') - newopts; |
568 | p = *oldopts; | 568 | p = *oldopts; |
569 | while (1) { | 569 | while (1) { |
570 | if (!strncmp(p, newopts, len) | 570 | if (!strncmp(p, newopts, len) |
@@ -579,7 +579,7 @@ static void append_mount_options(char **oldopts, const char *newopts) | |||
579 | *oldopts = p; | 579 | *oldopts = p; |
580 | skip: | 580 | skip: |
581 | newopts += len; | 581 | newopts += len; |
582 | while (newopts[0] == ',') newopts++; | 582 | while (*newopts == ',') newopts++; |
583 | } | 583 | } |
584 | } else { | 584 | } else { |
585 | if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts); | 585 | if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts); |