Skip to content

Commit 7afeddc

Browse files
committed
slightly safer return check for GetAppInstallDir
1 parent 5ecdca1 commit 7afeddc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package/launchdf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ int main(int argc, char* argv[]) {
356356
auto get_app_path_from_steam = [] (AppId_t appid) -> std::optional<std::filesystem::path> {
357357
char buf[2048] = "";
358358
int bytes = SteamApps()->GetAppInstallDir(appid, (char*)&buf, 2048);
359-
if (bytes == -1)
359+
if (bytes <= 0)
360360
return std::nullopt;
361361
// steam API counts the null terminator in the byte count returned
362362
if (buf[bytes] == '\0') bytes--;

0 commit comments

Comments
 (0)