diff options
| author | Christian Göttsche | 2024-05-29 20:38:23 +0200 |
|---|---|---|
| committer | jvoisin | 2024-06-06 16:27:35 +0200 |
| commit | f40955e03cd361966f927acfaa477cfceb8930e5 (patch) | |
| tree | be4213dd027ea2a8f0784068c5c84e2b5fd837ef /src/sp_utils.h | |
| parent | d82ab8d20191a9ebdb83f918c62fc6c32f068b01 (diff) | |
Avoid dropping const qualifier in casts
Adjusts casts to void dropping const qualifiers. This helps to avoid
mistakes, e.g. modifying string literals.
Also use size_t for length, similar to the upstream php interfaces.
Diffstat (limited to '')
| -rw-r--r-- | src/sp_utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sp_utils.h b/src/sp_utils.h index 7bab4ba..36caa52 100644 --- a/src/sp_utils.h +++ b/src/sp_utils.h | |||
| @@ -84,7 +84,7 @@ void unhook_functions(HashTable *ht); | |||
| 84 | int hook_regexp(const sp_pcre *, HashTable *, zif_handler); | 84 | int hook_regexp(const sp_pcre *, HashTable *, zif_handler); |
| 85 | bool check_is_in_eval_whitelist(const char* function_name); | 85 | bool check_is_in_eval_whitelist(const char* function_name); |
| 86 | int sp_log_request(zend_string const* const restrict folder, zend_string const* const restrict text_repr); | 86 | int sp_log_request(zend_string const* const restrict folder, zend_string const* const restrict text_repr); |
| 87 | #define sp_zend_string_equals(s1, s2) zend_string_equals((zend_string*)s1, (zend_string*)s2) | 87 | #define sp_zend_string_equals(s1, s2) zend_string_equals((const zend_string*)s1, (const zend_string*)s2) |
| 88 | static inline bool sp_zend_string_equals_str(const zend_string* s1, const char *str, size_t len) { | 88 | static inline bool sp_zend_string_equals_str(const zend_string* s1, const char *str, size_t len) { |
| 89 | return (ZSTR_LEN(s1) == len && !memcmp(ZSTR_VAL(s1), str, len)); | 89 | return (ZSTR_LEN(s1) == len && !memcmp(ZSTR_VAL(s1), str, len)); |
| 90 | } | 90 | } |
