changeset 281:cb24ffb23f7c

Make DTS not have problems if used multiple times. Storing a pointer to a static return value for future use is dangerous since the value might be overwritten by a subsequent call. Make DTS duplicate the string it creates instead of relying on the static return value staying valid.
author William Astle <lost@l-w.ca>
date Tue, 16 Jul 2013 21:48:49 -0600
parents 4370370f38d1
children 3c421f24c9b8
files lwasm/pseudo.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pseudo.c	Tue Jul 16 21:46:12 2013 -0600
+++ b/lwasm/pseudo.c	Tue Jul 16 21:48:49 2013 -0600
@@ -45,7 +45,7 @@
 	l -> len = 0;
 
 	tp = time(NULL);
-	t = l ->lstr = ctime(&tp);
+	t = l ->lstr = lw_strdup(ctime(&tp));
 
 	while (*t)
 	{