Quote:
- By using strcpy, strchr, strstr, etc, you are explicitly negating the possibility of using embedded \0's in the string. Furthermore, since you have the length of the strings, the functions memcpy, memmove and memchr are faster and let you use nil characters.
I figured that one out. Why am I using strcpy which will use strlen to find the length?
Quote:
- You are forgetting to check for NULL in essentially every function. strlen, for example, will most likely crash if you pass it a null pointer.
That is good criticism. I wonder why the code analyzer doesn't detect that?
Quote:
- IsEqual should negate the return value of strcmp, since strcmp returns zero on equal strings. You should use memcmp, anyway.
Removed IsEqual and made CmpStr instead... I don't see the point of IsEqual really, since it should wrap the C-functions.