summary refs log tree commit diff stats
path: root/src/common/server.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2012-11-03 10:24:25 -0700
committerArnavion <arnavion@gmail.com>2012-11-03 19:04:02 -0700
commit5d9264aff6d7bcdd2f0595bfdf2a3a7a23330d46 (patch)
tree17765368da40d67405ec22c0e1d608f706fbe055 /src/common/server.c
parente0b1724158d44370d34d108a5f07fe0b36e4e254 (diff)
Initial commit for utf8 everywhere.
Diffstat (limited to 'src/common/server.c')
-rw-r--r--src/common/server.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/server.c b/src/common/server.c
index 2bb133b1..6c4b3543 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -1718,21 +1718,21 @@ server_connect (server *serv, char *hostname, int port, int no_login)
 #ifdef USE_OPENSSL
 	if (serv->use_ssl)
 	{
-		char cert_file[256];
+		char *cert_file;
 
 		/* first try network specific cert/key */
-		snprintf (cert_file, sizeof (cert_file), "%s/%s.pem",
-					 get_xdir_fs (), server_get_network (serv, TRUE));
+		cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.pem",
+					 get_xdir (), server_get_network (serv, TRUE));
 		if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
 			SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM);
 		else
 		{
-			/* if that doesn't exist, try ~/.xchat2/client.pem */
-			snprintf (cert_file, sizeof (cert_file), "%s/%s.pem",
-						 get_xdir_fs (), "client");
+			/* if that doesn't exist, try <xdir>/client.pem */
+			cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "client.pem", get_xdir ());
 			if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
 				SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM);
 		}
+		g_free (cert_file);
 	}
 #endif