summaryrefslogtreecommitdiff
path: root/shlibs/mount
diff options
context:
space:
mode:
Diffstat (limited to 'shlibs/mount')
-rw-r--r--shlibs/mount/src/optstr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c
index 5e544658..c5c7c221 100644
--- a/shlibs/mount/src/optstr.c
+++ b/shlibs/mount/src/optstr.c
@@ -297,7 +297,7 @@ int mnt_optstr_get_option(char *optstr, const char *name,
*/
int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end)
{
- size_t sz = strlen(end);
+ size_t sz;
if (!optstr || !begin || !end)
return -EINVAL;
@@ -305,6 +305,8 @@ int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end)
if ((begin == *optstr || *(begin - 1) == ',') && *end == ',')
end++;
+ sz = strlen(end);
+
memmove(begin, end, sz + 1);
if (!*begin && *(begin - 1) == ',')
*(begin - 1) = '\0';