Explorar o código

Make text argument to strnlen const.

This is to match prototype on some versions of Mac OS X. The fix isn't
ideal - we shouldn't be defining strnlen at all if we know the system has
it, but if it fixes the build on some systems it can't be bad.

Thanks Joe Groff for the patch.
Jelmer Vernooij %!s(int64=13) %!d(string=hai) anos
pai
achega
223559c7f8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      dulwich/_objects.c

+ 1 - 1
dulwich/_objects.c

@@ -30,7 +30,7 @@ typedef int Py_ssize_t;
 #endif
 
 #if defined(__MINGW32_VERSION) || (defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070) || (defined(_MSC_VER) && _MSC_VER < 1400)
-size_t strnlen(char *text, size_t maxlen)
+size_t strnlen(const char *text, size_t maxlen)
 {
 	const char *last = memchr(text, '\0', maxlen);
 	return last ? (size_t) (last - text) : maxlen;