remove BLI_strnlen, use _strnlen as strnlen on windows.
cant test on windows but from what I can tell this exists like _vsnprintf
This commit is contained in:
@@ -128,7 +128,6 @@ char *BLI_strcasestr(const char *s, const char *find);
|
||||
int BLI_strcasecmp(const char *s1, const char *s2);
|
||||
int BLI_strncasecmp(const char *s1, const char *s2, int n);
|
||||
int BLI_natstrcmp(const char *s1, const char *s2);
|
||||
size_t BLI_strnlen(const char *str, size_t maxlen);
|
||||
|
||||
void BLI_timestr(double _time, char *str); /* time var is global */
|
||||
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
#ifndef vsnprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#ifndef strnlen
|
||||
#define strnlen _strnlen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/***/
|
||||
@@ -83,7 +86,7 @@ void BLI_dynstr_append(DynStr *ds, const char *cstr) {
|
||||
|
||||
void BLI_dynstr_nappend(DynStr *ds, const char *cstr, int len) {
|
||||
DynStrElem *dse= malloc(sizeof(*dse));
|
||||
int cstrlen= BLI_strnlen(cstr, len);
|
||||
int cstrlen= strnlen(cstr, len);
|
||||
|
||||
dse->str= malloc(cstrlen+1);
|
||||
memcpy(dse->str, cstr, cstrlen);
|
||||
|
||||
@@ -342,9 +342,3 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user