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