diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2021-05-23 13:03:52 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-23 13:03:52 -0400 | 
| commit | ea5afdccbd23d61e70f3ef62aabd9b6726b2c20f (patch) | |
| tree | 3423050eff8dda91c92aeeaf0c88ddba5b652e36 | |
| parent | Merge pull request #66 from LukeSmithxyz/revert-62-fast-scrolling-fix (diff) | |
| parent | Replace bughy implementation of function 'remove_all()'. (diff) | |
| download | dwmblocks-ea5afdccbd23d61e70f3ef62aabd9b6726b2c20f.tar.gz dwmblocks-ea5afdccbd23d61e70f3ef62aabd9b6726b2c20f.tar.bz2 dwmblocks-ea5afdccbd23d61e70f3ef62aabd9b6726b2c20f.tar.xz dwmblocks-ea5afdccbd23d61e70f3ef62aabd9b6726b2c20f.tar.zst dwmblocks-ea5afdccbd23d61e70f3ef62aabd9b6726b2c20f.zip | |
Merge pull request #75 from Murtaught/master
Replace buggy implementation of function 'remove_all()'.
| -rw-r--r-- | dwmblocks.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/dwmblocks.c b/dwmblocks.c index 18f58fb..563a07e 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -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 | 
