btscmp.c 408 B

1234567891011121314151617181920212223
  1. /* $Id$ */
  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. #include "ack_string.h"
  9. int
  10. btscmp(b1, n1, b2, n2)
  11. register char *b1, *b2;
  12. int n1, n2;
  13. {
  14. register n = (n1 <= n2) ? n1 : n2;
  15. while (n-- > 0) {
  16. if (*b1++ != *b2++)
  17. return *--b1 - *--b2;
  18. }
  19. return n2 - n1;
  20. }