@@ -123,7 +123,7 @@ END_EXTERN_C()
123123
124124#define ZSTR_ALLOCA_FREE (str , use_heap ) free_alloca(str, use_heap)
125125
126- #define ZSTR_INIT_LITERAL (s , persistent ) (zend_string_init((s), strlen (s), (persistent)))
126+ #define ZSTR_INIT_LITERAL (s , persistent ) (zend_string_init(("" s), sizeof (s) - 1 , (persistent)))
127127
128128/*---*/
129129
@@ -402,7 +402,7 @@ static zend_always_inline bool zend_string_starts_with(const zend_string *str, c
402402}
403403
404404#define zend_string_starts_with_literal (str , prefix ) \
405- zend_string_starts_with_cstr(str, prefix, strlen (prefix))
405+ zend_string_starts_with_cstr(str, "" prefix, sizeof (prefix) - 1 )
406406
407407static zend_always_inline bool zend_string_starts_with_cstr_ci (const zend_string * str , const char * prefix , size_t prefix_length )
408408{
@@ -415,7 +415,7 @@ static zend_always_inline bool zend_string_starts_with_ci(const zend_string *str
415415}
416416
417417#define zend_string_starts_with_literal_ci (str , prefix ) \
418- zend_string_starts_with_cstr_ci(str, prefix, strlen (prefix))
418+ zend_string_starts_with_cstr_ci(str, "" prefix, sizeof (prefix) - 1 )
419419
420420/*
421421 * DJBX33A (Daniel J. Bernstein, Times 33 with Addition)
0 commit comments