returns 1 if both are identical ...
It will leave the loop when the strings become different or when reach the end of str1 (then, the strings are equal, or else it would already been out of the loop because the short-circuited "and" operator)
then, we have 2 options:
1) *str1 is not null .... then, the strings are different.... (because it left the loop failing in condition *str1 == *str2)
2) *str1 is null .... then, if *str2 isn't null (str1 is an empty string and str2 not, maybe str1 == #0 and str2 == "a", for example), the strings are different, else, both are identical (they got compared every byte before it got out of the loop with *str1 == 0.
Am I wrong?
Main Topics
Browse All Topics





by: smitty1276Posted on 2003-08-21 at 21:32:17ID: 9200672
Does anyone see any " blatant undefined behaviour "?