[PATCH] unify itoa

Rich Felker dalias at aerifal.cx
Sun Jul 9 05:07:38 UTC 2006


On Sat, Jul 08, 2006 at 01:45:50PM -0400, Rob Landley wrote:
> On Saturday 08 July 2006 12:44 pm, Denis Vlasenko wrote:
> > Hi folks, Rob,
> >
> > Attached patch removes all instances of local itoa()-like
> > functions, introduces common one into libbb and uses
> > it where appropriate.
> 
> Is "sprintf" really that bad?  (Or xasprintf() out of our library when you 
> need it to malloc?)  Especially if the darn compiler actually starts doing 
> intelligent string merging, which it's inching towards...
> 
> You have a large quantity of code under #ifdef NOT_NEEDED_YET that by itself 
> would make me reject this patch.  (What's max_unsigned_power10() doing, 
> anyway, and is that really a sane way to do whatever it is?)

Agree, this code is INSANELY bloated. Use snprintf!

Rich




More information about the busybox mailing list