From 1e6e5b299c235b513095a76a4cd9fffc41e8fc9c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 17 Jun 2002 18:36:36 +0000 Subject: beginning to sync up for 2.2.5 release.... --- source/lib/util_str.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source/lib/util_str.c') diff --git a/source/lib/util_str.c b/source/lib/util_str.c index a2b01a0fc7e..f44341b8dd1 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -1332,3 +1332,37 @@ char *binary_string(char *buf, int len) s[j] = 0; return s; } + +#ifndef HAVE_STRNLEN +/******************************************************************* + Some platforms don't have strnlen +********************************************************************/ + + size_t strnlen(const char *s, size_t n) +{ + int i; + for (i=0; s[i] && i