Fixed an unchecked error in get_app_path().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@459 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-07-26 19:59:08 +00:00
parent b194af1035
commit 2a2585c598
@@ -1112,6 +1112,7 @@ StorageKit::get_app_path(char *buffer)
image_info info; image_info info;
int32 cookie = 0; int32 cookie = 0;
bool found = false; bool found = false;
if (error == B_OK) {
while (!found && get_next_image_info(0, &cookie, &info) == B_OK) { while (!found && get_next_image_info(0, &cookie, &info) == B_OK) {
if (info.type == B_APP_IMAGE) { if (info.type == B_APP_IMAGE) {
strncpy(buffer, info.name, B_PATH_NAME_LENGTH); strncpy(buffer, info.name, B_PATH_NAME_LENGTH);
@@ -1119,6 +1120,7 @@ StorageKit::get_app_path(char *buffer)
found = true; found = true;
} }
} }
}
if (error == B_OK && !found) if (error == B_OK && !found)
error = B_ENTRY_NOT_FOUND; error = B_ENTRY_NOT_FOUND;
return error; return error;