/* * Copyright (C) 1991, 1992 Linus Torvalds */ #include /** * strnlen - Find the length of a length-limited string * @s: The string to be sized * @count: The maximum number of bytes to search */ size_t strnlen(const char * s, size_t count) { const char *sc; for (sc = s; count-- && *sc != '\0'; ++sc) /* nothing */; return sc - s; } /* * Local variables: * mode: C * c-file-style: "BSD" * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: */