xref: /original-bsd/sys/libkern/locc.c (revision edc2ab72)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)locc.c	8.1 (Berkeley) 06/10/93
8  */
9 
10 #include <libkern/libkern.h>
11 
12 int
13 locc(mask0, cp0, size)
14 	int mask0;
15 	char *cp0;
16 	u_int size;
17 {
18 	register u_char *cp, *end, mask;
19 
20 	mask = mask0;
21 	cp = (u_char *)cp0;
22 	for (end = &cp[size]; cp < end && *cp != mask; ++cp);
23 	return (end - cp);
24 }
25