aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util-linux/mount.c8
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);