Gustavo Sverzut Barbieri wrote:
> Please check the -Wall -Wextra errors! U must check the return of
> asprintf() variants.... And then you can use the optimized
> append/insert that does not need to strlen()
>   

Or you get the size first with snprintf(NULL, 0 ...) and than write it 
with snprintf() directly into the buffer, this saves you one allocation. 
In the case of append you can
even fill the yet unused bytes of the buffer with snprintf() first, in 
some cases the buffer might be large enough so you don't need a 
following buffer resize and a second snprintf. The nice side effect is 
that you don't rely on gnu extensions.

Regards Peter

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to