4 * Copyright (C) 1991, 1992 Linus Torvalds
8 * stupid library routines.. The optimized versions should generally be found
9 * as inline code in <asm-xx/string.h>
11 * These are buggy as well..
13 * * Fri Jun 25 1999, Ingo Oeser <ioe@informatik.tu-chemnitz.de>
14 * - Added strsep() which will replace strtok() soon (because strsep() is
15 * reentrant and should be faster). Use only strsep() in new code, please.
17 * * Sat Feb 09 2002, Jason Thomas <jason@topic.com.au>,
18 * Matthew Hawkins <matt@mh.dropbear.id.au>
19 * - Kissed strtok() goodbye
22 #include <sys/types.h>
24 #include <asm/ctype.h>
27 #ifndef __HAVE_ARCH_STRNLEN
29 * strnlen - Find the length of a length-limited string
30 * @s: The string to be sized
31 * @count: The maximum number of bytes to search
33 size_t strnlen(const char *s
, size_t count
)
37 for (sc
= s
; count
-- && *sc
!= '\0'; ++sc
)