From 59cdff7055b078eb387e691a3f3f8c1ed1d6c873 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Fri, 9 Oct 2015 22:11:28 +0100 Subject: [PATCH] Potential fix to #639. The scenario name was missing its null to indicate the end of the string. This would cause scenarios to have odd fileNames that are compared against to compare a scenario against the scenario list --- src/scenario.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scenario.c b/src/scenario.c index b1b7ae7a45..ea2b96af52 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -236,7 +236,7 @@ int scenario_load_and_play_from_path(const char *path) if (!scenario_load(path)) return 0; - int len = strnlen(path, MAX_PATH); + int len = strnlen(path, MAX_PATH) + 1; strncpy(_scenarioPath, path, len); if (len == MAX_PATH) {