chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/disorder
[disorder]
/
lib
/
snprintf.c
diff --git
a/lib/snprintf.c
b/lib/snprintf.c
index e62e3c9434a80c0698d5ab69141710cff950f812..27ac595d81e1f7bc8f45f98d99ca620dd8c231c7 100644
(file)
--- a/
lib/snprintf.c
+++ b/
lib/snprintf.c
@@
-28,12
+28,24
@@
#include <stddef.h>
#include "printf.h"
#include <stddef.h>
#include "printf.h"
+#include "log.h"
#include "sink.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 {
struct fixedstr_sink {
+ /** @brief Base */
struct sink s;
struct sink s;
+
+ /** @brief Output buffer */
char *buffer;
char *buffer;
+
+ /** @brief Bytes written so far */
int nbytes;
int nbytes;
+
+ /** @brief Size of buffer */
size_t size;
};
size_t size;
};