summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-09-15 07:40:36 -0400
committerTingPing <tingping@tingping.se>2013-09-15 07:40:47 -0400
commitf13413c26a30bfa5615ab34b7a1acd5cb3336bba (patch)
treed9e2e450be9aad1552efce529ac190a2414ed56e
parentc9418ffca31ca62420600d0fbc9642902e14492a (diff)
Fix logging networks with invalid names on Windows
-rw-r--r--src/common/text.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/text.c b/src/common/text.c
index e0cdb5ee..d18b9c1a 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -518,7 +518,11 @@ log_create_pathname (char *servname, char *channame, char *netname)
 
 	if (!netname)
 	{
-		netname = "NETWORK";
+		netname = strdup ("NETWORK");
+	}
+	else
+	{
+		netname = log_create_filename (netname);
 	}
 
 	/* first, everything is in UTF-8 */
@@ -533,6 +537,7 @@ log_create_pathname (char *servname, char *channame, char *netname)
 
 	log_insert_vars (fname, sizeof (fname), prefs.hex_irc_logmask, channame, netname, servname);
 	free (channame);
+	free (netname);
 
 	/* insert time/date */
 	now = time (NULL);