Amitha Perera <[EMAIL PROTECTED]> writes:
> I have been meaning to write them up and post a patch to you guys,
> but other things keep intruding. I will try to get that done before
> mid-week, and hopefully that'll take care of this particular
> problem.
It would probably be worth a little time to go look at the liberty
code and see if we can just snatch their implementation without too
much rewriting. My guess is that we can't, but if we could, then we'd
be bug/feature compatible for the most part, and we wouldn't have to
do the implementation ourself. I imagine that a "correct", and
efficient implementataion of asprintf could be quite a pain. The
cheezy solution would be to use snprintf with larger and larger
malloced input strings, until you found one that would fit the string,
hopefully using a good initial guess so that you don't have to make
too many tries. Of course, then you'd have to decide whether or not
it was worth the time/space tradeoff to copy the result into an exact
length string and delete the first one...
If you actually have control over the code doing the formatting, as
you would with liberty, then you can do something much more efficient.
--
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
----- %< -------------------------------------------- >% ------
The GnuCash / X-Accountant Mailing List
To unsubscribe, send mail to [EMAIL PROTECTED] and
put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body