about summary refs log tree commit diff
path: root/litterbox.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-21 18:00:52 -0400
committerJune McEnroe <june@causal.agency>2020-08-21 18:00:52 -0400
commit4944437e894637ad99b3b22b3fd7aa60e3243aaa (patch)
tree9882ab4ac77286eaa3ef6bfd240d4568cd7aab2e /litterbox.c
parentUse configPath to load cert/priv (diff)
downloadlitterbox-4944437e894637ad99b3b22b3fd7aa60e3243aaa.tar.gz
litterbox-4944437e894637ad99b3b22b3fd7aa60e3243aaa.zip
Use a static buffer for base directory paths
Diffstat (limited to '')
-rw-r--r--litterbox.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/litterbox.c b/litterbox.c
index 72df0c4..5a88132 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -858,11 +858,9 @@ int main(int argc, char *argv[]) {
 		tls_config_insecure_noverifyname(config);
 	}
 
-	const char *dirs;
-	char pbuf[PATH_MAX];
 	if (cert) {
-		dirs = NULL;
-		while (NULL != (path = configPath(pbuf, sizeof(pbuf), &dirs, cert))) {
+		const char *dirs = NULL;
+		while (NULL != (path = configPath(&dirs, cert))) {
 			if (priv) {
 				error = tls_config_set_cert_file(config, path);
 			} else {
@@ -873,8 +871,8 @@ int main(int argc, char *argv[]) {
 		if (error) errx(EX_NOINPUT, "%s: %s", cert, tls_config_error(config));
 	}
 	if (priv) {
-		dirs = NULL;
-		while (NULL != (path = configPath(pbuf, sizeof(pbuf), &dirs, priv))) {
+		const char *dirs = NULL;
+		while (NULL != (path = configPath(&dirs, priv))) {
 			error = tls_config_set_key_file(config, path);
 			if (!error) break;
 		}