summary refs log tree commit diff
path: root/irc.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-21 16:47:54 -0400
committerJune McEnroe <june@causal.agency>2020-08-21 16:49:10 -0400
commit8190d76086e57a4b07e7ed39af3748a470f53b89 (patch)
tree36f030d39046cea3a6575b69d7a8721bc71dccae /irc.c
parentDocument how cert/priv are searched for (diff)
downloadcatgirl-8190d76086e57a4b07e7ed39af3748a470f53b89.tar.gz
catgirl-8190d76086e57a4b07e7ed39af3748a470f53b89.zip
Use a static buffer for base directory paths
Diffstat (limited to 'irc.c')
-rw-r--r--irc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/irc.c b/irc.c
index b87351c..5acc69f 100644
--- a/irc.c
+++ b/irc.c
@@ -27,7 +27,6 @@
 
 #include <assert.h>
 #include <err.h>
-#include <limits.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <stdarg.h>
@@ -61,12 +60,9 @@ void ircConfig(bool insecure, const char *cert, const char *priv) {
 		tls_config_insecure_noverifyname(config);
 	}
 
-	const char *path;
-	const char *dirs;
-	char buf[PATH_MAX];
 	if (cert) {
-		dirs = NULL;
-		while (NULL != (path = configPath(buf, sizeof(buf), &dirs, cert))) {
+		const char *dirs = NULL;
+		for (const char *path; NULL != (path = configPath(&dirs, cert));) {
 			if (priv) {
 				error = tls_config_set_cert_file(config, path);
 			} else {
@@ -77,8 +73,8 @@ void ircConfig(bool insecure, const char *cert, const char *priv) {
 		if (error) errx(EX_NOINPUT, "%s: %s", cert, tls_config_error(config));
 	}
 	if (priv) {
-		dirs = NULL;
-		while (NULL != (path = configPath(buf, sizeof(buf), &dirs, priv))) {
+		const char *dirs = NULL;
+		for (const char *path; NULL != (path = configPath(&dirs, priv));) {
 			error = tls_config_set_key_file(config, path);
 			if (!error) break;
 		}
.7&id=90c59ecba4c1c74d619eb42f9b4f2c4d2acf198d&follow=1'>Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe 2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe 2020-02-11Use time_t for save signatureJune McEnroe 2020-02-11Set self.nick to * initiallyJune McEnroe 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe