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 *read = str;
|
||||||
char *write = str;
|
char *write = str;
|
||||||
while (*read) {
|
while (*read) {
|
||||||
if (*read == to_remove) {
|
if (*read != to_remove) {
|
||||||
read++;
|
|
||||||
*write = *read;
|
*write = *read;
|
||||||
|
++write;
|
||||||
}
|
}
|
||||||
read++;
|
++read;
|
||||||
write++;
|
|
||||||
}
|
}
|
||||||
|
*write = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
//opens process *cmd and stores output in *output
|
//opens process *cmd and stores output in *output
|
||||||
|
|
Loading…
Reference in a new issue