From cb42ef255bd2fdd273301d257124f2521a2a860e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 12 Mar 2013 18:55:58 -0400 Subject: [PATCH] fix linux crash on sscanf failure --- BasiliskII/src/Unix/sys_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BasiliskII/src/Unix/sys_unix.cpp b/BasiliskII/src/Unix/sys_unix.cpp index bbe0d3af..40a72521 100644 --- a/BasiliskII/src/Unix/sys_unix.cpp +++ b/BasiliskII/src/Unix/sys_unix.cpp @@ -326,7 +326,7 @@ void SysAddDiskPrefs(void) line[len-1] = 0; // 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 (strcmp(fstype, "hfs") == 0) PrefsAddString("disk", dev);