Skip to content

Commit

Permalink
fix: update for builtin changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov committed Jan 26, 2024
1 parent 0a3f360 commit 67644a1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/uptime/uptime.c.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import math
import common

#include <time.h>
Expand Down Expand Up @@ -35,7 +34,7 @@ fn print_uptime(utmp_buf []C.utmpx) ! {
endptr := &char(0)
upsecs := C.strtod(&buf[0], &endptr)
if buf.bytestr() != endptr.vstring() {
if 0 <= upsecs && upsecs < math.max_f64 {
if 0 <= upsecs && upsecs < max_f64 {
uptime = i64(upsecs)
} else {
uptime = -1
Expand Down Expand Up @@ -79,7 +78,7 @@ fn print_uptime(utmp_buf []C.utmpx) ! {
return ''
}

if uptime == math.max_i64 {
if uptime == max_i64 {
print('up ???? days ??:??, ')
} else {
if 0 < updays {
Expand Down

0 comments on commit 67644a1

Please sign in to comment.