home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Magazine / Online / QMail / source / byte_diff.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-15  |  453 b   |  17 lines

  1. #include "byte.h"
  2.  
  3. int byte_diff(s,n,t)
  4. register char *s;
  5. register unsigned int n;
  6. register char *t;
  7. {
  8.   for (;;) {
  9.     if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
  10.     if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
  11.     if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
  12.     if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
  13.   }
  14.   return ((int)(unsigned int)(unsigned char) *s)
  15.        - ((int)(unsigned int)(unsigned char) *t);
  16. }
  17.