Skip to content

Commit 23c6fba

Browse files
committed
vala: use proper integer parsing APIs
1 parent 6594ceb commit 23c6fba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gnome-ask-password-agent.vala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ public class MyStatusIcon : StatusIcon {
156156
clock_gettime(1, out ts);
157157
uint64 now = (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
158158

159-
uint64 not_after;
160-
if (not_after_as_string.scanf("%llu", out not_after) != 1)
159+
uint64 not_after = uint64.parse(not_after_as_string);;
160+
if ((not_after == 0 && GLib.errno == Posix.EINVAL) ||
161+
(not_after == int64.MAX && GLib.errno == Posix.ERANGE))
161162
return false;
162163

163164
if (not_after > 0 && not_after < now)

0 commit comments

Comments
 (0)