Interesting - thank you for your feedback. It's educational to see the different points of view.
However, I wonder if you've actually taken on board either the point of the exercise, or the fact that it isn't yet finished.
However, questions such as those you raise are, of course, of great interest in production code, and would be raised in the discussion this code is intended to start. If someone started to write correct code that took these things into consideration the test would be stopped - it would've served its purpose already.
I'd be interested to know:
* Do you think every routine, every piece of code should have comments?
* Do you think every routine should test its input parameters? Every time?
* Do you think every routine should be checking for memory corruption? All the time?
* How do you cope with memory corruption in the program code itself?
* Do you think the routine fails if the char to remove is '\0'? Are you sure? You seem to claim it does.
* Do you believe that all code should always be written to the same standard?
Having written code in an environment where any given memory location has a MTC (Mean Time to Corruption) of 12 hours, I have considered these issues. I'd be interested to hear your experiences in these matters.
I notice also that you created your username specifically to reply to this item.
Welcome to Hacker News.