mirror of
https://github.com/yawut/SDL.git
synced 2026-06-13 20:20:38 -05:00
Fix crash with Linux supermount fstab entries (thanks Erno!)
This commit is contained in:
parent
46d9b34ab4
commit
e3a9b8d5a8
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user