# HG changeset patch # User William Astle # Date 1374032929 21600 # Node ID cb24ffb23f7c1edc9b84db53433a8d06956d04ea # Parent 4370370f38d105bb929e2a3f3e6b7ab33b29cfd8 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. diff -r 4370370f38d1 -r cb24ffb23f7c lwasm/pseudo.c --- 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) {