antirez / sds

Simple Dynamic Strings library for C
BSD 2-Clause "Simplified" License
4.89k stars 473 forks source link

sdscatfmt call sdsMakeRoomFor, asked for more space than intended #134

Open huangzhw opened 3 years ago

huangzhw commented 3 years ago

instead of asking for the extra new space it wanted, it asked to grow the string by the size it already has too. i.e. a string of 1000 bytes, needing to grow by 10 bytes, would have been asking for an additional 1010 bytes. As in https://github.com/redis/redis/pull/8286.