why get string from redis, will miss blank space -


For example:
I get string from command, is an empty space \ x00
127.0.0.1 : 6379 & gt; Get "87102213_87102208" "173275,3915125,10, \ x00"

But in the code in the print log, the empty space is erased. do you know?

log_error ("answer- gt; str:% s, answer-> len:% d", reply-> gt; str, reply-> len);
Answer-> Str: 173275,3915125,10, answer-> lane: 9 / <>

well- X00 is not empty space, it is a null character, which also has string terminator character in C. Most c APIs will use the string as a parameter, but it will be considered that the string closes at the first \ x00 character. Probably this log-in function is included.

However, the Redis Binary is safe, and all the characters are meaningful including placid four. When this value has been inserted, perhaps the size was wrong, so the string was also stored in the form of a null end.

Comments

Popular posts from this blog

php - how to change mysql_result($res, 0, "url"); to mysqli -

c# - Textbox not clickable but editable -

Matlab transpose a table vector -