shithub: cstory

Download patch

ref: 02bf38b8f65011a39b832bbcc752d8c29f07e265
parent: d15e1b7f41e040a937c4bbacc52849785d5bd036
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Aug 31 16:55:31 EDT 2020

Better logic

--- a/DoConfig/DoConfig.cpp
+++ b/DoConfig/DoConfig.cpp
@@ -39,12 +39,9 @@
 
 	for (size_t i = strlen(argv[0]);; --i)
 	{
-		if (i == 0 || argv[0][i] == '\\' || argv[0][i] == '/')
+		if (i == 0 || argv[0][i - 1] == '\\' || argv[0][i - 1] == '/')
 		{
 			const char config_string[] = "Config.dat";
-
-			if (argv[0][i] == '\\' || argv[0][i] == '/')
-				++i;	// Point to after the path separator
 
 			config_path = (char*)malloc(i + sizeof(config_string));