btscmp.c 387 B

123456789101112131415161718192021
  1. /* $Header$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* btscmp()
  7. */
  8. int
  9. btscmp(b1, n1, b2, n2)
  10. register char *b1, *b2;
  11. int n1, n2;
  12. {
  13. register n = (n1 <= n2) ? n1 : n2;
  14. while (n-- > 0) {
  15. if (*b1++ != *b2++)
  16. return *--b1 - *--b2;
  17. }
  18. return n2 - n1;
  19. }