summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
authorBerke Viktor <berkeviktor@aol.com>2012-02-16 17:21:15 +0100
committerBerke Viktor <berkeviktor@aol.com>2012-02-16 17:21:15 +0100
commit0ac0510be0270cde636bbd8c590ef9fbda9d90ef (patch)
treef98afc7c26bd81b226ebe2852ef6b35f66dfe3de /src/common/text.c
parentfc3d4d31f01a639972faf5fd5f85fc6602f53c1b (diff)
fix for time stamp format crashes
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 93392d1a..f8afc4b3 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -686,6 +686,13 @@ get_stamp_str (char *fmt, time_t tim, char **ret)
 	}
 
 	len = strftime (dest, sizeof (dest), fmt, localtime (&tim));
+#ifdef WIN32
+	if (!len)
+	{
+		/* use failsafe format until a correct one is specified */
+		len = strftime (dest, sizeof (dest), "[%H:%M]", localtime (&tim));
+	}
+#endif
 	if (len)
 	{
 		if (prefs.utf8_locale)