From 2894bea5dd92686c9022f7fcf691a8a7024c8243 Mon Sep 17 00:00:00 2001 From: Daniel Kamil Kozar Date: Sat, 29 Oct 2016 20:06:05 +0200 Subject: [PATCH] fix realpath() return value in platform_resolve_openrct_data_path realpath() returns NULL on error, so the existing code treated its success as a critical error. this commit fixes this. --- src/platform/posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/posix.c b/src/platform/posix.c index 2f813b582a..c549f55a47 100644 --- a/src/platform/posix.c +++ b/src/platform/posix.c @@ -697,8 +697,8 @@ void platform_get_openrct_data_path(utf8 *outPath, size_t outSize) void platform_resolve_openrct_data_path() { if (gCustomOpenrctDataPath[0] != 0) { - if (realpath(gCustomOpenrctDataPath, _openrctDataDirectoryPath)) { - log_error("Could not resolve path \"%s\"", gCustomOpenrctDataPath); + if (realpath(gCustomOpenrctDataPath, _openrctDataDirectoryPath) == NULL) { + log_error("Could not resolve path \"%s\", errno = %d", gCustomOpenrctDataPath, errno); return; }