fix linux crash on sscanf failure

This commit is contained in:
Hans de Goede 2013-03-12 18:55:58 -04:00 committed by Alexei Svitkine
parent 9f5d67497d
commit cb42ef255b

View File

@ -326,7 +326,7 @@ void SysAddDiskPrefs(void)
line[len-1] = 0; line[len-1] = 0;
// Parse line // Parse line
char *dev, *mnt_point, *fstype; char *dev = NULL, *mnt_point = NULL, *fstype = NULL;
if (sscanf(line, "%as %as %as", &dev, &mnt_point, &fstype) == 3) { if (sscanf(line, "%as %as %as", &dev, &mnt_point, &fstype) == 3) {
if (strcmp(fstype, "hfs") == 0) if (strcmp(fstype, "hfs") == 0)
PrefsAddString("disk", dev); PrefsAddString("disk", dev);