aboutsummaryrefslogtreecommitdiff
path: root/src/irc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc.c')
-rw-r--r--src/irc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/irc.c b/src/irc.c
index bfa1b90..d052937 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -119,8 +119,8 @@ static void do_priv_nick(void) {
the compiled code smaller, but it grew by ~50 bytes. avoid.
*/
static void print_ping_time(char *p) {
+ extern void print_jif_sec(unsigned int j);
static unsigned int now, pingtime;
- static unsigned int sec, frac;
now = read_rtclok();
pingtime = (unsigned int)a2uint(p);
@@ -128,19 +128,10 @@ static void print_ping_time(char *p) {
/* correct for rtclock rollover (every ~9 mins) */
if(now < pingtime) now |= 0x8000;
- pingtime = now - pingtime;
-
- sec = pingtime / timers.hz;
- frac = pingtime % timers.hz;
- frac *= 100;
- frac /= timers.hz;
-
scr_print_active("*** ");
scr_print_active(msg_src);
scr_print_active(" lag: ");
- scr_act_printnum(sec);
- scr_putc_active('.');
- scr_act_printnum(frac);
+ print_jif_sec(now - pingtime);
scr_putc_active('s');
}
@@ -791,7 +782,8 @@ static void hunt_screen(signed char dir) {
s += dir;
if(s < 0)
s = MAX_SCREENS - 1;
- s %= MAX_SCREENS;
+ if(s == MAX_SCREENS)
+ s = 0;
} while(scr_status[s] == SCR_UNUSED);
scr_display(s);