Fix overflow in mstime() in redis-cli and benchmark.

The problem does not exist in the Redis server implementation of mstime()
but is only limited to redis-cli and redis-benchmark.

Thix fixes issue #839.
This commit is contained in:
antirez 2012-12-20 15:20:55 +01:00
parent ebbc4ebb26
commit 4dc1e0dd30
2 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ static long long mstime(void) {
long long mst;
gettimeofday(&tv, NULL);
mst = ((long)tv.tv_sec)*1000;
mst = ((long long)tv.tv_sec)*1000;
mst += tv.tv_usec/1000;
return mst;
}

View File

@ -95,7 +95,7 @@ static long long mstime(void) {
long long mst;
gettimeofday(&tv, NULL);
mst = ((long)tv.tv_sec)*1000;
mst = ((long long)tv.tv_sec)*1000;
mst += tv.tv_usec/1000;
return mst;
}