00001 00007 /* Embedded XINU, Copyright (C) 2007. All rights reserved. */ 00008 00017 int memcmp (const void *s1, const void *s2, int n) 00018 { 00019 const unsigned char *c1; 00020 const unsigned char *c2; 00021 00022 for (c1 = s1, c2 = s2; n > 0; n--, c1++, c2++) 00023 { 00024 if (*c1 != *c2) 00025 { return ((int) *c1) - ((int) *c2); } 00026 } 00027 return 0; 00028 }