summaryrefslogtreecommitdiff
path: root/src/sp_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_utils.c')
-rw-r--r--src/sp_utils.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c
index e872abd..970f314 100644
--- a/src/sp_utils.c
+++ b/src/sp_utils.c
@@ -126,7 +126,6 @@ int sp_log_request(const zend_string* folder, const zend_string* text_repr,
126 } 126 }
127 fclose(file); 127 fclose(file);
128 128
129#undef CAT_AND_DEC
130 return 0; 129 return 0;
131} 130}
132 131
@@ -171,17 +170,17 @@ const zend_string* sp_zval_to_zend_string(const zval* zv) {
171 return Z_STR_P(zv); 170 return Z_STR_P(zv);
172 } 171 }
173 case IS_FALSE: 172 case IS_FALSE:
174 return zend_string_init("FALSE", 5, 0); 173 return zend_string_init("FALSE", sizeof("FALSE") - 1, 0);
175 case IS_TRUE: 174 case IS_TRUE:
176 return zend_string_init("TRUE", 4, 0); 175 return zend_string_init("TRUE", sizeof("TRUE") - 1, 0);
177 case IS_NULL: 176 case IS_NULL:
178 return zend_string_init("NULL", 4, 0); 177 return zend_string_init("NULL", sizeof("NULL") - 1, 0);
179 case IS_OBJECT: 178 case IS_OBJECT:
180 return zend_string_init("OBJECT", 6, 0); 179 return zend_string_init("OBJECT", sizeof("OBJECT") - 1, 0);
181 case IS_ARRAY: 180 case IS_ARRAY:
182 return zend_string_init("ARRAY", 5, 0); 181 return zend_string_init("ARRAY", sizeof("ARRAY") - 1, 0);
183 case IS_RESOURCE: 182 case IS_RESOURCE:
184 return zend_string_init("RESOURCE", 8, 0); 183 return zend_string_init("RESOURCE", sizeof("RESOURCE") - 1, 0);
185 } 184 }
186 return zend_string_init("", 0, 0); 185 return zend_string_init("", 0, 0);
187} 186}
@@ -353,7 +352,7 @@ int hook_function(const char* original_name, HashTable* hook_table,
353 } else { // TODO this can be moved somewhere else to gain some marginal perfs 352 } else { // TODO this can be moved somewhere else to gain some marginal perfs
354 CG(compiler_options) |= ZEND_COMPILE_NO_BUILTIN_STRLEN; 353 CG(compiler_options) |= ZEND_COMPILE_NO_BUILTIN_STRLEN;
355 char* mb_name = ecalloc(strlen(original_name) + 3 + 1, 1); 354 char* mb_name = ecalloc(strlen(original_name) + 3 + 1, 1);
356 memcpy(mb_name, "mb_", 3); 355 memcpy(mb_name, "mb_", sizeof("mb_") - 1);
357 memcpy(mb_name + 3, VAR_AND_LEN(original_name)); 356 memcpy(mb_name + 3, VAR_AND_LEN(original_name));
358 if (zend_hash_str_find(CG(function_table), VAR_AND_LEN(mb_name))) { 357 if (zend_hash_str_find(CG(function_table), VAR_AND_LEN(mb_name))) {
359 return hook_function(mb_name, hook_table, new_function); 358 return hook_function(mb_name, hook_table, new_function);