Use size_t/long to avoid truncation
Use size_t/long to avoid truncation

Equivalent changes introduced to redis sds.c via:
https://github.com/redis/redis/pull/4568

redis/hiredis,redis/hiredis,redis/hiredis