Hi all, I have a question concerning the library function str_scomp(). I see it used in the standard modem example source included with TcpNet library. I cannot find any documentation about its semantic, so, I'm wandering what is its relationship with the standard C library strcmp() function. I have to do partial match string comparison... is it suitable?
Regards, Andrea
This function compare two strings. cp must be 0-terminated, but sp does not have to be 0-terminated.
Function returns __TRUE when strings are equal or when the left part of sp is equal to cp (in case when strlen(sp) > strlen(cp)).
BOOL str_scomp (U8 *sp, U8 const *cp); /* Compare two strings. 'cp' must be 0-terminated. */
Franc
"cp must be 0-terminated, but sp does not have to be"
So, presumably, sp must be at least as long as cp?
What happens if sp is shorter than cp - especially if sp is not null-terminated?