Преглед на файлове

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 години
родител
ревизия
223559c7f8
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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;