[BusyBox] improved format function for utility.c

Manuel Novoa III mnovoa3 at bellsouth.net
Thu Feb 8 19:55:33 UTC 2001


Here is a replacement for the format function in utility.c.
On i386 with -Os -fomit-frame-pointer, I get the following sizes:

   text	   data	    bss	    dec	    hex	filename
    139	      0	     10	    149	     95	new without 0-val test
    151	      0	     10	    161	     a1	new with 0-val test
    268	     10	      0	    278	    116	original function

One minor (very unlikely bug) fixed... if val > LONG_MAX and hr == 1, the
original code would output a negative value due to the %ld format being used.

Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fmt.c
Type: text/x-c
Size: 941 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20010208/caebe2a3/attachment.bin 


More information about the busybox mailing list