Explorar el 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 hace 13 años
padre
commit
223559c7f8
Se han modificado 1 ficheros con 1 adiciones y 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;