Merge branch 'master' into fastscroll_fix

using pulled version of fix to remove_all bug (with an improvement)
This commit is contained in:
dfuehrer 2021-06-01 20:54:26 -07:00
commit 681b8998c2

View file

@ -53,11 +53,13 @@ void replace(char *str, char old, char new)
void remove_all(char *str, char to_remove) { void remove_all(char *str, char to_remove) {
char *read = str; char *read = str;
char *write = str; char *write = str;
do { while (*read) {
while (*read == to_remove) read++; if (*read != to_remove) {
*write++ = *read; *write++ = *read;
read++; }
} while (*(read-1)); ++read;
}
*write = '\0';
} }
int gcd(int a, int b) int gcd(int a, int b)