Now only prints out the path if the path was initialized successfully - else

the app would crash in this case (because BPath::Path() could return NULL
then).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8883 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-09-07 01:50:08 +00:00
parent 0f3697566d
commit df435e99c2
+4 -1
View File
@@ -35,7 +35,10 @@ PrintMountPoint(dev_t device, bool verbose)
BDirectory root;
if (volume.GetRootDirectory(&root) == B_OK) {
BPath path(&root, NULL);
strlcpy(mount, path.Path(), sizeof(mount));
if (path.InitCheck() == B_OK)
strlcpy(mount, path.Path(), sizeof(mount));
else
strlcpy(mount, "?", sizeof(mount));
}
if (verbose)