Kaynağa Gözat

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 13 yıl önce
ebeveyn
işleme
223559c7f8
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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;