Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2012-05-18 01:45:32 +0400
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2012-05-18 01:45:32 +0400
commitf8f552e3b24ce7dbcbae2b0b4fecb9dd091a4a90 (patch)
treec7ff11fe6e014fa073bd6cb43a402ce18d66fba2 /library.c
parent74675fb774ccfeb2a005c892803b8db9fb425ac3 (diff)
Cleaner handling of large values on 32-bits.
Tested on 32-bits, addresses GitHub issue #174.
Diffstat (limited to 'library.c')
-rw-r--r--library.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/library.c b/library.c
index 930244a9..94816a74 100644
--- a/library.c
+++ b/library.c
@@ -550,16 +550,16 @@ PHPAPI void redis_long_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_s
}
if(response[0] == ':') {
- long ret = atol(response + 1);
+ long long ret = atoll(response + 1);
IF_MULTI_OR_PIPELINE() {
- if(ret > (long)LONG_MAX) { /* overflow */
+ if(ret > LONG_MAX) { /* overflow */
add_next_index_stringl(z_tab, response+1, response_len-1, 1);
} else {
efree(response);
add_next_index_long(z_tab, (long)ret);
}
} else {
- if(ret > (long)LONG_MAX) { /* overflow */
+ if(ret > LONG_MAX) { /* overflow */
RETURN_STRINGL(response+1, response_len-1, 1);
} else {
efree(response);