From 23913af8b66c3bec05f937bb31c72fffe935df05 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 15 Jan 2018 17:59:39 +0100 Subject: Minor simplification --- src/sp_utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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) { return true; } } else { - char* idx_str = emalloc(snprintf(NULL, 0, "%lu", idx) + 1); - - sprintf(idx_str, "%lu", idx); // This could use a log. + char* idx_str = NULL; + spprintf(&idx_str, 0, "%lu", idx); if (sp_match_value(idx_str, to_match, rx)) { efree(idx_str); return true; -- cgit v1.3