diff options
author | bviktor <bviktor@outlook.com> | 2012-11-03 21:48:56 -0700 |
---|---|---|
committer | bviktor <bviktor@outlook.com> | 2012-11-03 21:48:56 -0700 |
commit | 3c5284f19de644e010d0dfe85d179fb5633c92fb (patch) | |
tree | cfcfb0f27d78dd65bb657f0e0caeabb42737cc03 /src/common/server.c | |
parent | e0b1724158d44370d34d108a5f07fe0b36e4e254 (diff) | |
parent | c2c23894fc4e376ff10c9c3cbcfa5c350c1e3073 (diff) |
Merge pull request #224 from Arnavion/utf8-everywhere
UTF-8 everywhere
Diffstat (limited to 'src/common/server.c')
-rw-r--r-- | src/common/server.c | 12 |
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 |