mirror of
https://github.com/diegocr/libnix.git
synced 2026-09-12 03:30:29 +00:00
15 lines
196 B
C
15 lines
196 B
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
size_t strnlen(const char *s, size_t len)
|
|
{
|
|
size_t i;
|
|
|
|
if( s == NULL )
|
|
return 0;
|
|
|
|
for(i = 0; i < len && s[i]; i++)
|
|
;
|
|
return i;
|
|
}
|