summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2014-04-21 01:39:28 -0700
committerArnavion <arnavion@gmail.com>2014-04-21 01:39:28 -0700
commitdc27640265dcbe480ad137831f3a22f35bd07b51 (patch)
treed80b5b4cbe641d094a6ee71f4fd1f25b8154fd1d /src/common/text.c
parent41c209bf45ce1a926c526959cae2dc94fec7c0b9 (diff)
Use utf-8 variant of strftime to format log file paths.
strftime assumes the format string is in locale encoding, which mangles log file paths that are in utf-8.

Fixes #767
Fixes #945
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 00f311c0..efd8fba2 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -540,7 +540,6 @@ log_create_pathname (char *servname, char *channame, char *netname)
 {
 	char fname[384];
 	char fnametime[384];
-	struct tm *tm;
 	time_t now;
 
 	if (!netname)
@@ -568,8 +567,7 @@ log_create_pathname (char *servname, char *channame, char *netname)
 
 	/* insert time/date */
 	now = time (NULL);
-	tm = localtime (&now);
-	strftime_validated (fnametime, sizeof (fnametime), fname, tm);
+	strftime_utf8 (fnametime, sizeof (fnametime), fname, now);
 
 	/* create final path/filename */
 	if (logmask_is_fullpath ())