Skip to content

Commit 0bd2e2c

Browse files
Fix INCRBY/DECRBY for large values
Thanks to @maxixcom for discovering that we were using int values for INCR(BY) and DECR(BY), which caused some issues with large values. Fixes issue phpredis#212
1 parent f1231c9 commit 0bd2e2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ PHPAPI void redis_atomic_increment(INTERNAL_FUNCTION_PARAMETERS, char *keyword,
11331133
if (val == 1) {
11341134
cmd_len = redis_cmd_format_static(&cmd, keyword, "s", key, key_len);
11351135
} else {
1136-
cmd_len = redis_cmd_format_static(&cmd, keyword, "sd", key, key_len, (int)val);
1136+
cmd_len = redis_cmd_format_static(&cmd, keyword, "sl", key, key_len, val);
11371137
}
11381138
if(key_free) efree(key);
11391139

0 commit comments

Comments
 (0)