From e066a954f5b638103102250d87661d91f3c9f3f0 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 7 Jun 2021 00:09:58 -0400 Subject: Replace catf with seprintf --- chat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chat.c') 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 -- cgit 1.4.1