2018-04-05 14:23:14 +00:00
|
|
|
#ifndef LLARP_STRING_H
|
|
|
|
#define LLARP_STRING_H
|
2018-12-12 02:52:51 +00:00
|
|
|
|
2019-01-10 19:41:51 +00:00
|
|
|
#include <util/common.hpp>
|
2018-04-05 14:43:16 +00:00
|
|
|
|
2018-05-29 12:12:47 +00:00
|
|
|
#ifndef __FreeBSD__
|
2018-06-17 15:26:00 +00:00
|
|
|
#if !(__APPLE__ && __MACH__)
|
2018-05-22 15:54:19 +00:00
|
|
|
size_t INLINE
|
|
|
|
strnlen(const char* str, size_t sz)
|
|
|
|
{
|
2018-04-05 14:43:16 +00:00
|
|
|
size_t slen = 0;
|
2020-04-07 18:38:56 +00:00
|
|
|
while (sz-- && str[slen])
|
2018-05-22 15:54:19 +00:00
|
|
|
slen++;
|
2018-04-05 14:43:16 +00:00
|
|
|
return slen;
|
|
|
|
}
|
2018-06-17 15:26:00 +00:00
|
|
|
#endif
|
2018-05-29 12:12:47 +00:00
|
|
|
#endif
|
2018-04-05 14:43:16 +00:00
|
|
|
|
2018-04-05 14:23:14 +00:00
|
|
|
#endif
|