X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/132a5a4a47f9dbc7c52ee15234d70258c59ccf8e..4019fe4dab5da2a8352a6b2bdda6732ce7d4e366:/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; };