Skip to content

Commit

Permalink
Update to previous patch (remove the strcpy.)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltje committed May 30, 2023
1 parent da3a763 commit 583c3b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libtcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit 583c3b4

Please sign in to comment.