https://bugs.launchpad.net/dulwich/+bug/822427 --- dulwich/_objects.c +++ dulwich/_objects.c @@ -21,21 +21,15 @@ #include #include -#if defined(__APPLE__) -#include -#endif - #if (PY_VERSION_HEX < 0x02050000) typedef int Py_ssize_t; #endif -#if defined(__MINGW32_VERSION) || (defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070) -size_t strnlen(char *text, size_t maxlen) +static size_t dwstrnlen(char *text, size_t maxlen) { const char *last = memchr(text, '\0', maxlen); return last ? (size_t) (last - text) : maxlen; } -#endif #define bytehex(x) (((x)<0xa)?('0'+(x)):('a'-0xa+(x))) @@ -98,7 +92,7 @@ text++; - namelen = strnlen(text, len - (text - start)); + namelen = dwstrnlen(text, len - (text - start)); name = PyString_FromStringAndSize(text, namelen); if (name == NULL) {