Procházet zdrojové kódy

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 před 13 roky
rodič
revize
223559c7f8
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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;