On 08/24/2015 03:10 PM, enh wrote: > On Sun, Aug 23, 2015 at 6:20 PM, Rob Landley <[email protected]> wrote: >> /me wists for a specification. Oh well. I hate when I have to guess at >> what the right behavior _is_... > > yeah, i was actually trying to avoid ending up with all the heuristics > the BSD implementation has. > > the BSD man page says: > > If the formatted number (including suffix) would be too long to fit into > buf, then divide number by 1024 until it will.
That's just "test against 999, divide by 1024". Easy enough. > The len argument must be at least 4 plus the length of suffix, in order > to ensure a useful result is generated into buf. That constraint's already implicit. I should make sure it's explicit. > so it certainly seems they follow the "no more than three digits/two > digits plus '.'" rule. I can work with this. Thanks, Rob _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
