Merge pull request #75 from Murtaught/master
Replace buggy implementation of function 'remove_all()'.
This commit is contained in:
commit
ea5afdccbd
1 changed files with 4 additions and 4 deletions
|
@ -51,13 +51,13 @@ void remove_all(char *str, char to_remove) {
|
|||
char *read = str;
|
||||
char *write = str;
|
||||
while (*read) {
|
||||
if (*read == to_remove) {
|
||||
read++;
|
||||
if (*read != to_remove) {
|
||||
*write = *read;
|
||||
++write;
|
||||
}
|
||||
read++;
|
||||
write++;
|
||||
++read;
|
||||
}
|
||||
*write = '\0';
|
||||
}
|
||||
|
||||
//opens process *cmd and stores output in *output
|
||||
|
|
Loading…
Reference in a new issue