I think you want 
    
    
    s.setLen snprintf(s.cstring, s.cap + 1, "Foo bar %s", "Hello")
    # or
    s.setLen snprintf(s.cstring, MAX_LEN + 1, "Foo bar %s", "Hello")
    
    
    Run

Otherwise, the longest string snprintf could write is only 1023 (plus a null), 
while the Nim string could be up to 1024 non-null characters.

Reply via email to