Skip to content
Snippets Groups Projects
Commit b9333a0b authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Another attempt to silence Coverity.

This may be the first time in my life that I've used difftime()...
which is strictly one of only two things you're actually allowed
to do with a time_t per the C standard (the other is convert into
a broken-down time).
parent fd5e663e
No related branches found
No related tags found
1 merge request!488Overhaul LZH code
Pipeline #7539 passed
...@@ -334,6 +334,7 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv) ...@@ -334,6 +334,7 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv)
static int oldspeed = 0; static int oldspeed = 0;
static int lastmouse = 0; static int lastmouse = 0;
int newmouse; int newmouse;
double timeond;
int timeon; int timeon;
char sep; char sep;
int oldfont_norm; int oldfont_norm;
...@@ -378,12 +379,13 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv) ...@@ -378,12 +379,13 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv)
lastupd = now; lastupd = now;
lastmouse = newmouse; lastmouse = newmouse;
oldspeed = speed; oldspeed = speed;
if (now > (bbs->connected + 359999)) timeond = difftime(now, bbs->connected);
if (timeond > 350000)
timeon = 350000; timeon = 350000;
else if (now < bbs->connected) else if (timeond < 0)
timeon = 0; timeon = 0;
else else
timeon = (int)(now - bbs->connected); timeon = timeond;
gettextinfo(&txtinfo); gettextinfo(&txtinfo);
oldscroll = _wscroll; oldscroll = _wscroll;
hold_update = true; hold_update = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment