Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions redis_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -2944,14 +2944,19 @@ int redis_hincrbyfloat_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
}

static inline zval *coerce_hash_field(zval *zv, zval *aux) {
char buf[32];
zend_long lv;
size_t len;

if (UNEXPECTED(Z_TYPE_P(zv) == IS_STRING &&
is_numeric_string(Z_STRVAL_P(zv),
Z_STRLEN_P(zv), &lv, NULL, 0) == IS_LONG))
{
ZVAL_LONG(aux, lv);
return aux;
len = snprintf(buf, sizeof(buf), "%ld", lv);
if (len == Z_STRLEN_P(zv) && redis_strncmp(Z_STRVAL_P(zv), buf, len) == 0) {
ZVAL_LONG(aux, lv);
return aux;
}
}

return zv;
Expand Down
Loading