summaryrefslogtreecommitdiff
path: root/src/libudev/time-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libudev/time-util.c')
-rw-r--r--src/libudev/time-util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libudev/time-util.c b/src/libudev/time-util.c
index d7682773c4..6f76e8c19b 100644
--- a/src/libudev/time-util.c
+++ b/src/libudev/time-util.c
@@ -38,10 +38,10 @@ usec_t timespec_load(const struct timespec *ts) {
if (ts->tv_sec == (time_t) -1 &&
ts->tv_nsec == (long) -1)
- return (usec_t) -1;
+ return USEC_INFINITY;
if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC)
- return (usec_t) -1;
+ return USEC_INFINITY;
return
(usec_t) ts->tv_sec * USEC_PER_SEC +
@@ -71,7 +71,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
assert(buf);
assert(l > 0);
- if (t == (usec_t) -1)
+ if (t == USEC_INFINITY)
return NULL;
if (t <= 0) {
@@ -83,7 +83,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
/* The result of this function can be parsed with parse_sec */
for (i = 0; i < ELEMENTSOF(table); i++) {
- int k;
+ int k = 0;
size_t n;
bool done = false;
usec_t a, b;