This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Overlapped Buffers for string functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]