Fixed source and destination overlap in sprintf() (i.e. in strcpy() inside)

pull/4302/head^2
AlexeyAB 6 years ago
parent 3555beb914
commit 71e8354589
  1. 2
      src/utils.c

@ -218,7 +218,7 @@ void find_replace_extension(char *str, char *orig, char *rep, char *output)
int offset = (p - buffer);
int chars_from_end = strlen(buffer) - offset;
if (!p || chars_from_end != strlen(orig)) { // Is 'orig' even in 'str' AND is 'orig' found at the end of 'str'?
sprintf(output, "%s", str);
sprintf(output, "%s", buffer);
free(buffer);
return;
}

Loading…
Cancel
Save