154171Sbostic /*- 2*63186Sbostic * Copyright (c) 1992, 1993 3*63186Sbostic * The Regents of the University of California. All rights reserved. 454171Sbostic * 554171Sbostic * %sccs.include.redist.c% 654171Sbostic * 7*63186Sbostic * @(#)locc.c 8.1 (Berkeley) 06/10/93 854171Sbostic */ 954171Sbostic 1056518Sbostic #include <libkern/libkern.h> 1154184Sbostic 1254171Sbostic int locc(mask0,cp0,size)1354179Storeklocc(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