Overlapped Buffers for string functions

Sankar P sankar.curiosity@gmail.com
Thu May 14 08:12:00 GMT 2009


On Wed, May 13, 2009 at 4:50 AM, Petr Baudis <pasky@suse.cz> wrote:
>> This function internally could do just,
>>
>>                 sprintf (buffer + strlen (buffer), format, ...);
>>
>> + plus other error checks
>>
>> (2) Is it okay to implement this new api - saprintf ?  I am willing to
>> give a patch, if the idea is approved.
>
> I don't personally think a new API would be beneficial when this is so
> trivially doable already.
>

I believe strlen (null) would crash. So, the callers will have to
check for the validity of the bug before issuing the strelen.  And
from some of the code I read, it looked like saprintf may be a nice
thing to have.

Just to scratch my intellectual itch, I will try to write a patch and
post here over the weekend. We can reject it if it is deemed useless.
Thanks a lot for your explanation. :-)

--
Sankar
http://psankar.blogspot.com



More information about the Libc-help mailing list