Pristine Ack-5.5
[Ack-5.5.git] / modules / src / string / btscmp.c
1 /* $Id: btscmp.c,v 1.5 1994/06/24 11:22:28 ceriel Exp $ */
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
9 #include "ack_string.h"
10
11 int
12 btscmp(b1, n1, b2, n2)
13         register char *b1, *b2;
14         int n1, n2;
15 {
16         register n = (n1 <= n2) ? n1 : n2;
17
18         while (n-- > 0) {
19                 if (*b1++ != *b2++)
20                         return *--b1 - *--b2;
21         }
22         return n2 - n1;
23 }