aboutsummaryrefslogtreecommitdiff
path: root/xsnprintf.h
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-01-14 21:30:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-21 10:57:46 +0000
commitd2c00d73ec087e2266d8e07daacb0732fc1ca761 (patch)
tree4bdbf8d3c357ac6880de00a06f83402bac48518b /xsnprintf.h
parentsixel: current geometry: don’t exceed current window dimensions (diff)
Add xsnprintf() and remove some unnecessary strlen(3) calls
Diffstat (limited to 'xsnprintf.h')
-rw-r--r--xsnprintf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/xsnprintf.h b/xsnprintf.h
new file mode 100644
index 00000000..c745ef3e
--- /dev/null
+++ b/xsnprintf.h
@@ -0,0 +1,8 @@
+#pragma once
+
+#include <stdarg.h>
+#include <stddef.h>
+#include "macros.h"
+
+size_t xsnprintf(char *buf, size_t len, const char *fmt, ...) PRINTF(3) NONNULL_ARGS;
+size_t xvsnprintf(char *buf, size_t len, const char *fmt, va_list ap) VPRINTF(3) NONNULL_ARGS;