I'm porting an application from AIX to Solaris that uses mbsncmp().
I know that mbscmp() can be substituted with strcoll(), but I
can't find an equivalent for mbsncmp(). Tried to use a combination
of strxfrm() and strncmp() but with no luck.
original code:
char *s1 = "abcd";
char *s2 = "abcde";
int rc = mbsncmp(s1, s2, 4);
thought this would work, but it doesn't... :
char string1[128], string2[128];
char *s1 = "abcd";
char *s2 = "abcde";
int size1 = strxfrm(string1, s1, 128);
int size2 = strxfrm(string2, s2, 128);
int rc = strncmp(string1, string2, size1);
Thanks,
Bob