Convert time-related variables to consistently use "unsigned long".
[srvx.git] / src / mod-snoop.c
index 11a0e55050cc5bb12ae3f5cdf6e6cac97aae30f5..899309d59e6004b6e43ac1a7a698d4afc4a977d3 100644 (file)
@@ -42,7 +42,6 @@
 #include <arpa/inet.h>
 #endif
 
-extern time_t now;
 static struct {
     struct chanNode *channel;
     struct userNode *bot;
@@ -56,7 +55,7 @@ static int finalized;
 int snoop_finalize(void);
 
 #define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS)
-#define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now))
+#define UPDATE_TIMESTAMP() do { time_t feh = now; strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&feh)); } while (0)
 
 static void
 snoop_nick_change(struct userNode *user, const char *old_nick) {