From 89c5cf1f40f58e5dfe3da4a47228ce96246fdc5f Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sun, 29 Sep 1996 01:36:34 +0000 Subject: [PATCH] strlen + strncpy - strcpy git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@792 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/strnlen.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/roken/strnlen.c diff --git a/lib/roken/strnlen.c b/lib/roken/strnlen.c new file mode 100644 index 000000000..6c53b85d7 --- /dev/null +++ b/lib/roken/strnlen.c @@ -0,0 +1,15 @@ +/* Copyright 1996 */ + +#ifdef HAVE_CONFIG_H +#include +RCSID("$Id$"); +#endif + +int +strnlen(char *s, int len) +{ + int i; + for(i = 0; i < len && s[i]; i++) + ; + return i; +}