1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 20:44:56 +00:00

strcpy shouldn't be used for overlapping strings

This commit is contained in:
Nikolas Garofil 2009-05-10 13:14:54 +02:00
parent 2afe66ed01
commit f7568b0753

View File

@ -6693,10 +6693,13 @@ static FILE *open_config_file(const char *f)
void remove_comments(char *string) {
char *curplace;
char *newend = NULL;
char *tmpstring; //strcpy can't be used for overlapping strings
for(curplace = string; *curplace != 0; curplace++) {
if(*curplace == '\\' && *(curplace + 1) == '#') {
strcpy(curplace, curplace + 1);
tmpstring = strdup(curplace);
strcpy(curplace, tmpstring + 1);
free(tmpstring);
} else if(*curplace == '#' && !newend) {
newend = curplace;
} else if(*curplace == '\n' && newend) {