From 583c3b47466b80de9fe8a6b9ac4e6c4709187284 Mon Sep 17 00:00:00 2001 From: waltje Date: Mon, 29 May 2023 20:46:44 -0400 Subject: [PATCH] Update to previous patch (remove the strcpy.) --- libtcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index 8fc1d1bd..0f6ebe57 100644 --- a/libtcc.c +++ b/libtcc.c @@ -123,6 +123,7 @@ static inline char *config_tccdir_w32(char *path) /* No 'include' folder found, so go up one level. */ strncpy(temp, path, sizeof(temp)-1); + /* Try this for several "levels" up. */ for (c = 0; c < 4; c++) { p = tcc_basename(temp); if (p > temp) { @@ -136,7 +137,6 @@ static inline char *config_tccdir_w32(char *path) if (_access(try, 0) == 0) { if (p != NULL) p = '\0'; - path = tcc_malloc(strlen(temp)+1); strcpy(path, temp); break; }