Commit 0d4c3555 authored by Sam Lantinga's avatar Sam Lantinga

Fix crash with Linux supermount fstab entries (thanks Erno!)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40248
parent 0ed6cab8
......@@ -203,18 +203,24 @@ static void CheckMounts(const char *mtab)
if ( strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) {
tmp = strstr(mntent->mnt_opts, "fs=");
if ( tmp ) {
strcpy(mnt_type, tmp+strlen("fs="));
tmp = strchr(mnt_type, ',');
if ( tmp ) {
*tmp = '\0';
free(mnt_type);
mnt_type = strdup(tmp + strlen("fs="));
if ( mnt_type ) {
tmp = strchr(mnt_type, ',');
if ( tmp ) {
*tmp = '\0';
}
}
}
tmp = strstr(mntent->mnt_opts, "dev=");
if ( tmp ) {
strcpy(mnt_dev, tmp+strlen("dev="));
tmp = strchr(mnt_dev, ',');
if ( tmp ) {
*tmp = '\0';
free(mnt_dev);
mnt_dev = strdup(tmp + strlen("dev="));
if ( mnt_dev ) {
tmp = strchr(mnt_dev, ',');
if ( tmp ) {
*tmp = '\0';
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment