• Egor Seredin's avatar
    Allow '\0' inside of result of sdscatvprintf, and efficiency improvements (#6260) · 3bf02ea7
    Egor Seredin authored
    This will allow to use: RedisModule_CreateStringPrintf(ctx, "%s %c %s", "string1", 0, "string2");
    
    On large string, the previous code would incrementally retry to double the output buffer.
    now it uses the the return value of snprintf and grows to the right size in one step.
    
    and also avoids an excessive strlen in sdscat at the end.
    
    (cherry picked from commit f4ca3d87)
    3bf02ea7
sds.c 40.8 KB