• Egor Seredin's avatar
    Allow '\0' inside of result of sdscatvprintf, and efficiency improvements (#6260) · f4ca3d87
    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.
    f4ca3d87
sds.c 41.5 KB