blob: ca1bb07fe1302d05a4d1a1c558c7ae58c5142640 [file] [log] [blame]
#ifndef _STRNLEN_H
#define _STRNLEN_H
#include <cstddef>
namespace
{
// This function is identical to strnlen(), which is not found on Darwin.
inline size_t _strnlen(const char *s, size_t maxlen) {
size_t i;
for (i = 0; i < maxlen && s[i]; ++i)
;
return i;
}
}
#endif