summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-30 13:21:53 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-30 13:21:53 -0500
commitb35a780479bbf5038a825d415f9ca49c92f6b425 (patch)
tree44e71007552714b03ae812e466495ec5c8a7e27b /util.c
parenta61d90c32d4d6448148894872ebd91eb8f10fc2e (diff)
ctrl+q to quit (with unsaved changes dialog)
Diffstat (limited to 'util.c')
-rw-r--r--util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util.c b/util.c
index 59ece04..7a970a2 100644
--- a/util.c
+++ b/util.c
@@ -57,6 +57,9 @@ static char *str_dup(char const *src) {
// first, check that str is actually an array
#define strbuf_printf(str, ...) assert(sizeof str != 4 && sizeof str != 8), \
str_printf(str, sizeof str, __VA_ARGS__)
+#define str_catf(str, size, ...) str_printf((str) + strlen(str), (size) - strlen(str), __VA_ARGS__)
+#define strbuf_catf(str, ...) assert(sizeof str != 4 && sizeof str != 8), \
+ str_catf(str, sizeof str, __VA_ARGS__)
// on 16-bit systems, this is 16383. on 32/64-bit systems, this is 1073741823
// it is unusual to have a string that long.