From df435e99c27ba4e5a24474a3667416af0eefa5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 7 Sep 2004 01:50:08 +0000 Subject: [PATCH] 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 --- src/apps/bin/df.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/apps/bin/df.cpp b/src/apps/bin/df.cpp index 9373704399..2793c0f255 100644 --- a/src/apps/bin/df.cpp +++ b/src/apps/bin/df.cpp @@ -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)