diff options
| author | jvoisin | 2017-10-30 14:32:44 +0100 |
|---|---|---|
| committer | jvoisin | 2017-10-30 14:34:29 +0100 |
| commit | 0c77d1dcd817bd159682344d186e920cd8c9c150 (patch) | |
| tree | 43705cd797b8422ee76c974395c3dafca293e096 /src/sp_utils.c | |
| parent | 7757a9a46fe7379292b1b99df692f90a131e5bc7 (diff) | |
Minor code cleanup
Diffstat (limited to 'src/sp_utils.c')
| -rw-r--r-- | src/sp_utils.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index fdd2b66..1ba0fe7 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -183,19 +183,14 @@ int sp_log_request(const char* folder) { | |||
| 183 | 183 | ||
| 184 | static char *zv_str_to_char(zval *zv) { | 184 | static char *zv_str_to_char(zval *zv) { |
| 185 | zval copy; | 185 | zval copy; |
| 186 | char *ret; | ||
| 187 | |||
| 188 | 186 | ||
| 189 | ZVAL_ZVAL(©, zv, 1, 0); | 187 | ZVAL_ZVAL(©, zv, 1, 0); |
| 190 | // str = zend_string_dup(Z_STR_P(zv), 0); | ||
| 191 | for (size_t i = 0; i < Z_STRLEN(copy); i++) { | 188 | for (size_t i = 0; i < Z_STRLEN(copy); i++) { |
| 192 | if (Z_STRVAL(copy)[i] == '\0') { | 189 | if (Z_STRVAL(copy)[i] == '\0') { |
| 193 | Z_STRVAL(copy)[i] = '0'; | 190 | Z_STRVAL(copy)[i] = '0'; |
| 194 | } | 191 | } |
| 195 | } | 192 | } |
| 196 | ret = estrdup(Z_STRVAL(copy)); | 193 | return estrdup(Z_STRVAL(copy)); |
| 197 | // zend_string_release(str); | ||
| 198 | return ret; | ||
| 199 | } | 194 | } |
| 200 | 195 | ||
| 201 | 196 | ||
