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.
This commit is contained in:
Daniel Kamil Kozar 2016-10-29 20:06:05 +02:00 committed by Michał Janiszewski
parent 43ec7febff
commit 2894bea5dd
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}