]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: eliminate print_uuint recursion
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Sep 2024 23:16:43 +0000 (16:16 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 28 Sep 2024 00:42:59 +0000 (17:42 -0700)
commit0619c4a49130a9ea09ca8ac7774d6810f641aab5
tree1560148edc0a8f44f67b3fe77b0cd86627947c5c
parentd84afaa0a794fe1fd68cc3a7d5b1d783b90f3d01
factor: eliminate print_uuint recursion

* src/factor.c (lbuf_putint_append): New function, with
most of the old lbuf_putint body.  Do the umaxtostr stuff
by hand so that we needn’t worry about the trailing NUL.a
Do the string copy by hand since the string is so short.
(lbuf_putint): Reimplement in terms of lbuf_putint_append.
Omit last arg, which is no longer needed.  All callers changed.
(print_uuint): Rewrite to avoid recursion, using
lbuf_putint_append for the usual case.
src/factor.c