diff options
| author | jvoisin | 2018-01-15 17:59:39 +0100 |
|---|---|---|
| committer | jvoisin | 2018-01-15 17:59:39 +0100 |
| commit | 23913af8b66c3bec05f937bb31c72fffe935df05 (patch) | |
| tree | 0220103191591139712f6ed364eedfc6ab4e0673 /src | |
| parent | ca16e6264f8d901e97051c2cb4a14e12e1fce211 (diff) | |
Minor simplification
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_utils.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index 6612e6c..6e39b0a 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -284,9 +284,8 @@ bool sp_match_array_key(const zval* zv, const char* to_match, const pcre* rx) { | |||
| 284 | return true; | 284 | return true; |
| 285 | } | 285 | } |
| 286 | } else { | 286 | } else { |
| 287 | char* idx_str = emalloc(snprintf(NULL, 0, "%lu", idx) + 1); | 287 | char* idx_str = NULL; |
| 288 | 288 | spprintf(&idx_str, 0, "%lu", idx); | |
| 289 | sprintf(idx_str, "%lu", idx); // This could use a log. | ||
| 290 | if (sp_match_value(idx_str, to_match, rx)) { | 289 | if (sp_match_value(idx_str, to_match, rx)) { |
| 291 | efree(idx_str); | 290 | efree(idx_str); |
| 292 | return true; | 291 | return true; |
