summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
authorbendem <online@bendem.be>2015-03-02 19:58:27 +0100
committerbendem <online@bendem.be>2015-03-02 19:58:27 +0100
commit36a8ba126c6fe5612a4450560f62b20736723095 (patch)
treedb4efc32c96bddad9996ca0d3db8f3fe11e197e2 /src/common/text.c
parent658f30ec43c654fea8cd5e60fa7736791648e5c8 (diff)
Fix incorrect timestamp in scrollback with server-time
Fixes #1148
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 00bc3729..11516ae2 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -207,10 +207,9 @@ scrollback_shrink (session *sess)
 }
 
 static void
-scrollback_save (session *sess, char *text)
+scrollback_save (session *sess, char *text, time_t stamp)
 {
 	char *buf;
-	time_t stamp;
 	int len;
 
 	if (sess->type == SESS_SERVER && prefs.hex_gui_tab_server == 1)
@@ -238,7 +237,8 @@ scrollback_save (session *sess, char *text)
 			return;
 	}
 
-	stamp = time (0);
+	if (!stamp)
+		stamp = time(0);
 	if (sizeof (stamp) == 4)	/* gcc will optimize one of these out */
 		buf = g_strdup_printf ("T %d ", (int) stamp);
 	else
@@ -831,7 +831,7 @@ PrintTextTimeStamp (session *sess, char *text, time_t timestamp)
 	}
 
 	log_write (sess, text, timestamp);
-	scrollback_save (sess, text);
+	scrollback_save (sess, text, timestamp);
 	fe_print_text (sess, text, timestamp, FALSE);
 	g_free (text);
 }