diff options
author | June McEnroe <june@causal.agency> | 2021-06-07 00:09:58 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-06-09 11:56:35 -0400 |
commit | e066a954f5b638103102250d87661d91f3c9f3f0 (patch) | |
tree | ac6694692bcea35ca8b0a29318cbbfcf5a849428 /chat.c | |
parent | Add seprintf (diff) | |
download | catgirl-e066a954f5b638103102250d87661d91f3c9f3f0.tar.gz catgirl-e066a954f5b638103102250d87661d91f3c9f3f0.zip |
Replace catf with seprintf
Diffstat (limited to '')
-rw-r--r-- | chat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chat.c b/chat.c index 1c8e37c..653a6ab 100644 --- a/chat.c +++ b/chat.c @@ -313,14 +313,14 @@ int main(int argc, char *argv[]) { if (self.restricted) unveilAll(trust, cert, priv); char promises[64] = "stdio tty"; - struct Cat cat = { promises, sizeof(promises), strlen(promises) }; - if (save || logEnable) catf(&cat, " rpath wpath cpath"); - if (!self.restricted) catf(&cat, " proc exec"); + char *ptr = &promises[strlen(promises)], *end = &promises[sizeof(promises)]; + if (save || logEnable) ptr = seprintf(ptr, end, " rpath wpath cpath"); + if (!self.restricted) ptr = seprintf(ptr, end, " proc exec"); char *promisesFinal = strdup(promises); if (!promisesFinal) err(EX_OSERR, "strdup"); - catf(&cat, " rpath inet dns"); + seprintf(ptr, end, " rpath inet dns"); int error = pledge(promises, NULL); if (error) err(EX_OSERR, "pledge"); #endif |