From 46fdd044ce560f90dc1df1ff3659f265abee9f42 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Tue, 17 Jul 2018 14:01:12 -0700 Subject: [PATCH] Initialize engine_path when abspath fails. --- core/metamod.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/metamod.cpp b/core/metamod.cpp index 0ce0bd3..4ef9988 100644 --- a/core/metamod.cpp +++ b/core/metamod.cpp @@ -375,7 +375,13 @@ void InitializeVSP() break; } } - abspath(engine_path, engine_file); + + /* If this fails the file either does not exist or + * on Windows the buffer may be too small. */ + if (abspath(engine_path, engine_file) == NULL) + { + engine_path[0] = '\0'; + } const char *usepath = metamod_path.c_str(); if (UTIL_Relatize(rel_path, sizeof(rel_path), engine_path, metamod_path.c_str()))