diff options
Diffstat (limited to 'src/cmd.c')
| -rw-r--r-- | src/cmd.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -229,20 +229,13 @@ static void send_ctcp(void) { txbuf_send(); } -long read_rtclok(void) { - long r; - - r = ((long)OS.rtclok[0] << 16); - r |= (OS.rtclok[1] << 8); - r |= OS.rtclok[2]; - - return r; +/* only the bottom 15 bits! */ +unsigned int read_rtclok(void) { + return ((OS.rtclok[1] << 8) | (OS.rtclok[2])) & 0x7fff; } static void rtclok_to_numbuf(void) { - long r; - r = read_rtclok(); - ltoa(r, numbuf, 10); + itoa(read_rtclok(), numbuf, 10); } static void do_ctcp_ping(void) { |
