Subversion Repositories Kolibri OS

Rev

Rev 8793 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <assert.h>
  3. #include <string.h>
  4.  
  5. int memcmp(const void* s1, const void* s2, size_t n)
  6. {
  7.     if (n != 0) {
  8.         const unsigned char *p1 = s1, *p2 = s2;
  9.         do {
  10.             if (*p1++ != *p2++)
  11.                 return (*--p1 - *--p2);
  12.         } while (--n != 0);
  13.     }
  14.     return 0;
  15. }