diff options
author | Steve Bennett <steveb@workware.net.au> | 2016-03-27 13:57:37 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-03-27 14:03:01 +1000 |
commit | 09a51ce09670b8cb8fa33e29320f9b0980cb837a (patch) | |
tree | 457cc0bd17bb810ac71d20f43740abdd37212321 | |
parent | 14a44ad1274ed11f168cae905bf4bde62f8eb073 (diff) | |
download | jimtcl-09a51ce09670b8cb8fa33e29320f9b0980cb837a.zip jimtcl-09a51ce09670b8cb8fa33e29320f9b0980cb837a.tar.gz jimtcl-09a51ce09670b8cb8fa33e29320f9b0980cb837a.tar.bz2 |
exec: Avoid lstrcpyn on windows and just use snprintf()
-rw-r--r-- | jim-exec.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1396,8 +1396,7 @@ JimWinFindExecutable(const char *originalName, char fullPath[MAX_PATH]) static char extensions[][5] = {".exe", "", ".bat"}; for (i = 0; i < (int) (sizeof(extensions) / sizeof(extensions[0])); i++) { - lstrcpyn(fullPath, originalName, MAX_PATH - 5); - lstrcat(fullPath, extensions[i]); + snprintf(fullPath, MAX_PATH, "%s%s", originalName, extensions[i]); if (SearchPath(NULL, fullPath, NULL, MAX_PATH, fullPath, NULL) == 0) { continue; |