summaryrefslogtreecommitdiff
path: root/epan/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/print.c')
-rw-r--r--epan/print.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/print.c b/epan/print.c
index a54d84873a..f365f0ed94 100644
--- a/epan/print.c
+++ b/epan/print.c
@@ -247,13 +247,15 @@ write_pdml_preamble(FILE *fh, const gchar *filename)
{
time_t t = time(NULL);
struct tm * timeinfo;
- char *ts;
+ char *fmt_ts;
+ const char *ts;
/* Create the output */
timeinfo = localtime(&t);
if (timeinfo != NULL) {
- ts = asctime(timeinfo);
- ts[strlen(ts)-1] = 0; /* overwrite \n */
+ fmt_ts = asctime(timeinfo);
+ fmt_ts[strlen(fmt_ts)-1] = 0; /* overwrite \n */
+ ts = fmt_ts;
} else
ts = "Not representable";