Patrick Monnerat <[email protected]> schreef:

> 
>Oscar Koeroo wrote:
>
>> count = snprintf(NULL, 0, "myformat");
>> buf = malloc(count);
>> snprintf(buf, count, "myformat");
>
>I would use:
>
>count = snprintf(NULL, 0, "myformat") + 1;
>
>to include nul-terminator...

I defend my obvious and stupid mistake by claiming this to me pseudo code and 
that I should not type this stuff in a hurry... 
My bad\0


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to