diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-04-16 12:07:12 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-04-16 12:07:12 +0000 |
commit | b66932e1a5dc3a368474e6e110c5a88a251465f5 (patch) | |
tree | 3c8ed799fc19b11c24e8bdf57ae1b28724db4a23 /source3/lib/util_str.c | |
parent | 02f84c6bd0c06c3dacc93d6413d6645367f42744 (diff) | |
download | samba-b66932e1a5dc3a368474e6e110c5a88a251465f5.tar.gz samba-b66932e1a5dc3a368474e6e110c5a88a251465f5.tar.bz2 samba-b66932e1a5dc3a368474e6e110c5a88a251465f5.zip |
fixed the handling of STR_TERMINATE
(This used to be commit dbc6b137a83cf9fe0558625dd32f92f15296fba6)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r-- | source3/lib/util_str.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 6fdca658cd..9a841a36b3 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1001,3 +1001,15 @@ some platforms don't have strndup return ret; } #endif + +#ifndef HAVE_STRNLEN +/******************************************************************* +some platforms don't have strndup +********************************************************************/ + size_t strnlen(const char *s, size_t n) +{ + int i; + for (i=0; s[i] && i<n; i++) /* noop */ ; + return i; +} +#endif |