154171Sbostic /*- 254171Sbostic * Copyright (c) 1992 The Regents of the University of California. 354171Sbostic * All rights reserved. 454171Sbostic * 554171Sbostic * %sccs.include.redist.c% 654171Sbostic * 7*56518Sbostic * @(#)locc.c 7.4 (Berkeley) 10/11/92 854171Sbostic */ 954171Sbostic 10*56518Sbostic #include <libkern/libkern.h> 1154184Sbostic 1254171Sbostic int 1354179Storek locc(mask0, cp0, size) 1454179Storek int mask0; 1554179Storek char *cp0; 1654184Sbostic u_int size; 1754171Sbostic { 1854184Sbostic register u_char *cp, *end, mask; 1954171Sbostic 2054179Storek mask = mask0; 2154184Sbostic cp = (u_char *)cp0; 2254171Sbostic for (end = &cp[size]; cp < end && *cp != mask; ++cp); 2354171Sbostic return (end - cp); 2454171Sbostic } 25