Le 22 sept. 2015 09:40, "Tom Hacohen" <[email protected]> a écrit : > > On 22/09/15 17:32, Cedric BAIL wrote: > > Le 22 sept. 2015 02:30, "Daniel Kolesa" <[email protected]> a écrit : > >> > >> On Mon, Sep 21, 2015 at 11:24 PM, Shilpa Singh < [email protected]> > > wrote: > >>> cedric pushed a commit to branch master. > >>> > >>> > > http://git.enlightenment.org/core/efl.git/commit/?id=abaf29cb768375957c9ee0b64d36034c21c618ea > >>> > >>> commit abaf29cb768375957c9ee0b64d36034c21c618ea > >>> Author: Shilpa Singh <[email protected]> > >>> Date: Mon Sep 21 23:48:16 2015 +0200 > >>> > >>> eina_tmpstr: add eina_tmpstr_strftime > >> > >> This API seems awfully arbitrary and I don't really see the point. > >> Might as well be any other function that prints to strings - are you > >> gonna add these too? Sounds horrible to me. > > > > Is it better to have our code cluttered by static buffer and no overflow > > check ? Obviously not. Yes,I expect we refactor all our buffer print code > > as it is pretty bad right now and may even lead to security issue in some > > case. > > Just to chime in, I think this doomsday scenario is a bit exaggerated. > I think having code like: > > char buf[SOME_LEN]; > strftime(...buf...); > return tmpstr_add(buf); > > Is a much cleaner solution than adding all of the string functions of > the world to tmpstr, strbuf, stringshare and etc. > > I really don't like code duplication, and I think that's where Daniel is > coming from. > > What do you think?
It's a good example that won't always work and increase at best the stack size requirement for absolutely no good reason. I see no reason to have bad code like that just for fewer line of code. Cedric > -- > Tom. > > > ------------------------------------------------------------------------------ > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
