Closed liuzhuoling2011 closed 6 years ago
Just guessing - isn't it showing the string because of first 0 byte (\x00
) which simply leads to ""
?
Strings in C are null-terminated, so if you print them they will be empty if there are only null values in it. The length however is correct, so you can safely copy out the necessary data (only zeroes in this case)
Currently I face a problem witch makes me so confusing, when I get binary data (string) from redis:
![2](https://user-images.githubusercontent.com/8407297/34596404-6d71e54a-f21a-11e7-8cd8-c920d8ac56fb.png)
reply->type=1, reply->len=296, reply->str=""
Therefor, I can't get anything from hiredis reply. I use the same command in redis-cli, it will return the binary data.