atoi, when unable to convert the string to a number (like in atoi("Redis")), returns 0, which is indistinguishable from atoi("0").
Redis uses a lot of atoi, which causes some bugs. For example: I set maxmemory and timeout in redis.conf like this, then startup Redis.
maxmemory foobared
timeout 012foobared
Redis server startup successfully. Then fetch the two parameters:
127.0.0.1:6379> config get timeout
1) "timeout"
2) "12"
127.0.0.1:6379> config get maxmemory
1) "maxmemory"
2) "0"
Obviously, the result is not correct. Because atoi converts string to digital failed, but it does not return the error message.
Comment From: shenlongxing
@antirez Would you help me to identify this? If you agree with me, i will open a PR to fix this.
Comment From: yoav-steinberg
Thanks. I commented in the PR (#5137) lets discuss there... Closing.