Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-05-08 11:34:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-05-08 11:34:01 +0400
commitad068e6351e5b9b5d3c5e050602941a2fd8cdde6 (patch)
tree9c5ee65f07f3050ea3b31b135c6e0e055e604d01 /source/blender/blenlib
parentfcaca6c5bde7c580fa9c7d2445ec5c98418b7cbc (diff)
remove BLI_strnlen, use _strnlen as strnlen on windows.
cant test on windows but from what I can tell this exists like _vsnprintf
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_string.h1
-rw-r--r--source/blender/blenlib/intern/BLI_dynstr.c5
-rw-r--r--source/blender/blenlib/intern/string.c6
3 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index 39123a438df..c722ffb1693 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -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 */
diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index 5b61a86305b..4754d3bd8c3 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -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);
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index c344d8c0711..bc9614667a7 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -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;
-}