Skip to content

Commit

Permalink
Fix crash with Linux supermount fstab entries (thanks Erno!)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 5, 2001
1 parent 2a929ff commit 0d009db
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/cdrom/linux/SDL_syscdrom.c
Expand Up @@ -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';
}
}
}
}
Expand Down

0 comments on commit 0d009db

Please sign in to comment.