summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-01-26 16:49:21 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-01-26 16:49:21 +0000
commit99a34347332c89e831bd6990db692b8ec10ca345 (patch)
tree5a37543ecf89ba4f7b679b2afeda0690e15a99c3 /src/irc
parent0e91f0c2086bd5c4b38fa3cf62c204fa3eb096f8 (diff)
downloadweechat-99a34347332c89e831bd6990db692b8ec10ca345.zip
Fixed bug with elapsed time when away if computer clock was changed (displays 0 if elapsed time is negative)
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc-send.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c
index a68c3b31e..9cf873106 100644
--- a/src/irc/irc-send.c
+++ b/src/irc/irc-send.c
@@ -234,7 +234,7 @@ irc_send_away (t_irc_server *server, char *arguments)
{
char *string, buffer[4096];
t_gui_window *ptr_window;
- time_t elapsed;
+ time_t time_now, elapsed;
if (arguments)
{
@@ -269,7 +269,9 @@ irc_send_away (t_irc_server *server, char *arguments)
server->is_away = 0;
if (server->away_time != 0)
{
- elapsed = time (NULL) - server->away_time;
+ time_now = time (NULL);
+ elapsed = (time_now >= server->away_time) ?
+ time_now - server->away_time : 0;
server->away_time = 0;
if (cfg_irc_display_away != CFG_IRC_DISPLAY_AWAY_OFF)
{