revert own commit 28662.

strnlen is a GNU extension according to http://unixpapa.com/incnote/string.html
This commit is contained in:
2010-05-08 15:37:29 +00:00
parent d906d8ce3a
commit 9c1a9d9379
3 changed files with 8 additions and 4 deletions

View File

@@ -342,3 +342,9 @@ void BLI_timestr(double _time, char *str)
str[11]=0;
}
/* determine the length of a fixed-size string */
size_t BLI_strnlen(const char *str, size_t maxlen)
{
const char *end = memchr(str, '\0', maxlen);
return end ? (size_t) (end - str) : maxlen;
}