X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..b59c46fd2f2c5d094ad9d7b72fec772b99356419:/lib/snprintf.c diff --git a/lib/snprintf.c b/lib/snprintf.c index e62e3c9..27ac595 100644 --- a/lib/snprintf.c +++ b/lib/snprintf.c @@ -28,12 +28,24 @@ #include #include "printf.h" +#include "log.h" #include "sink.h" +/** @brief A @ref sink that stores to a fixed buffer + * + * If there is too much output, it is truncated. + */ struct fixedstr_sink { + /** @brief Base */ struct sink s; + + /** @brief Output buffer */ char *buffer; + + /** @brief Bytes written so far */ int nbytes; + + /** @brief Size of buffer */ size_t size; };