]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/string/sprintf/: [v]aprintf(): Add functions
authorAlejandro Colomar <alx@kernel.org>
Wed, 1 Jan 2025 12:10:35 +0000 (13:10 +0100)
committerSerge Hallyn <serge@hallyn.com>
Wed, 4 Jun 2025 04:25:02 +0000 (23:25 -0500)
commit5949132308ca976fd51fbade778564b0f15644bb
tree1270d439d825ba9b421bca4f13d9a7ffa9a9bfff
parent5fc6509dcb2305f8738f942c65e7bdaa754fce9c
lib/string/sprintf/: [v]aprintf(): Add functions

These functions are just like [v]asprintf(3), but simpler.

They return the newly allocated memory, which allows us to use the
[[gnu::malloc(free)]] attribute, which enhances static analysis.
They also omit the length, which we don't care about at all.

As a curiosity, Plan9 seems to provide this same API, under the name
smprint(3).

Link: <https://9fans.github.io/plan9port/man/man3/print.html>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/string/sprintf/aprintf.c [new file with mode: 0644]
lib/string/sprintf/aprintf.h [new file with mode: 0644]