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_ifilter.c | |
| 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 'src/sp_ifilter.c')
| -rw-r--r-- | src/sp_ifilter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_ifilter.c b/src/sp_ifilter.c index 9c46875..67eb5f3 100644 --- a/src/sp_ifilter.c +++ b/src/sp_ifilter.c | |||
| @@ -24,7 +24,7 @@ static const char sp_is_dangerous_char[256] = { | |||
| 24 | /* 0xf0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | 24 | /* 0xf0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | static void sp_server_strip(HashTable *svars, char *key, int keylen) { | 27 | static void sp_server_strip(HashTable *svars, const char *key, size_t keylen) { |
| 28 | zval *value = zend_hash_str_find(svars, key, keylen); | 28 | zval *value = zend_hash_str_find(svars, key, keylen); |
| 29 | if (!value || Z_TYPE_P(value) != IS_STRING) { return; } | 29 | if (!value || Z_TYPE_P(value) != IS_STRING) { return; } |
| 30 | 30 | ||
| @@ -39,7 +39,7 @@ static void sp_server_strip(HashTable *svars, char *key, int keylen) { | |||
| 39 | } | 39 | } |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | static void sp_server_encode(HashTable *svars, char *key, int keylen) { | 42 | static void sp_server_encode(HashTable *svars, const char *key, size_t keylen) { |
| 43 | zval *value = zend_hash_str_find(svars, key, keylen); | 43 | zval *value = zend_hash_str_find(svars, key, keylen); |
| 44 | if (!value || Z_TYPE_P(value) != IS_STRING) { return; } | 44 | if (!value || Z_TYPE_P(value) != IS_STRING) { return; } |
| 45 | 45 | ||
