X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..96f6312a0a827d2f90e7ab88d3a203c56eb82a9f:/lib/snprintf.c?ds=sidebyside 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; };