X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..2c6ee627861951ee978793cca4fd14638c34976f:/lib/snprintf.c diff --git a/lib/snprintf.c b/lib/snprintf.c index e62e3c9..f272dc7 100644 --- a/lib/snprintf.c +++ b/lib/snprintf.c @@ -30,10 +30,21 @@ #include "printf.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; };