Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u32_t memcmp()
- {
- if(z == 0)
- {
- return (z-1); // return -1 if there's nothing to compare
- }
- for(z = y; z >= 0; z--)
- {
- if(*offset1 == *offset2)
- {
- offset1++;
- offset2++;
- }
- else
- {
- return (*offset1 - *offset2); // return the length into the compare that the difference started(if the 2 aren't the same)
- }
- }
- return z; // return 0 if the compare was successful
- }
Advertisement