Counterexample for old implementation: char str[] = "aaa"; remove_all(str, 'a'); printf("%s\n", str); // displays "a" if we're lucky, //or crashes if we're not.