home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d110 / pdc.lha / Pdc / lib / memcmp.c < prev    next >
Text File  |  1987-10-28  |  567b  |  26 lines

  1. /*
  2.  * memcmp - compare bytes
  3.  */
  4.  
  5. int                                    /* <0, == 0, >0 */
  6. memcmp(s1, s2, size)
  7. CONST VOIDSTAR s1;
  8. CONST VOIDSTAR s2;
  9. SIZET size;
  10. {
  11.          register CONST char *scan1;
  12.          register CONST char *scan2;
  13.          register SIZET n;
  14.  
  15.          scan1 = s1;
  16.          scan2 = s2;
  17.          for (n = size; n > 0; n--)
  18.                    if (*scan1 == *scan2) {
  19.                              scan1++;
  20.                              scan2++;
  21.                    } else
  22.                              return(*scan1 - *scan2);
  23.  
  24.          return(0);
  25. }
  26.