strlen + strncpy - strcpy

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@792 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-09-29 01:36:34 +00:00
parent 5387b76026
commit 89c5cf1f40

15
lib/roken/strnlen.c Normal file
View File

@@ -0,0 +1,15 @@
/* Copyright 1996 */
#ifdef HAVE_CONFIG_H
#include <config.h>
RCSID("$Id$");
#endif
int
strnlen(char *s, int len)
{
int i;
for(i = 0; i < len && s[i]; i++)
;
return i;
}