mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-12999: zend_strnlen build fix when platform misses strnlen support.
fix from @rainerjung
This commit is contained in:
1
NEWS
1
NEWS
@@ -5,6 +5,7 @@ PHP NEWS
|
||||
- Core:
|
||||
. Fixed bug GH-12953 (false positive SSA integrity verification failed when
|
||||
loading composer classmaps with more than 11k elements). (nielsdos)
|
||||
. Fixed bug GH-12999 (zend_strnlen build when strnlen is unsupported). (rainerjung)
|
||||
|
||||
- Cli:
|
||||
. Fix incorrect timeout in built-in web server when using router script and
|
||||
|
||||
@@ -269,7 +269,7 @@ static zend_always_inline size_t zend_strnlen(const char* s, size_t maxlen)
|
||||
#if defined(HAVE_STRNLEN)
|
||||
return strnlen(s, maxlen);
|
||||
#else
|
||||
const char *p = memchr(s, '\0', maxlen);
|
||||
const char *p = (const char *)memchr(s, '\0', maxlen);
|
||||
return p ? p-s : maxlen;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user