25
25
smart_str_appendl_ex((dest), (src), strlen(src), (what))
26
26
#define smart_str_appends (dest , src ) \
27
27
smart_str_appendl((dest), (src), strlen(src))
28
+ #define smart_str_trim_to_len (dest ) \
29
+ smart_str_trim_to_len_ex((dest), 0)
28
30
#define smart_str_finalize (dest ) \
29
31
smart_str_finalize_ex((dest), 0)
30
32
#define smart_str_extend (dest , len ) \
@@ -78,7 +80,7 @@ static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, boo
78
80
return len ;
79
81
}
80
82
81
- static zend_always_inline void smart_str_trim_to_len (smart_str * str , bool persistent )
83
+ static zend_always_inline void smart_str_trim_to_len_ex (smart_str * str , bool persistent )
82
84
{
83
85
if (str -> s && str -> a > ZSTR_LEN (str -> s )) {
84
86
str -> s = zend_string_realloc (str -> s , ZSTR_LEN (str -> s ), persistent );
@@ -92,7 +94,7 @@ static zend_always_inline zend_string* smart_str_finalize_ex(smart_str *str, boo
92
94
return ZSTR_EMPTY_ALLOC ();
93
95
}
94
96
95
- smart_str_trim_to_len (str , persistent );
97
+ smart_str_trim_to_len_ex (str , persistent );
96
98
zend_string * retval = str -> s ;
97
99
98
100
str -> s = NULL ;
0 commit comments