From: Yu Watanabe Date: Fri, 21 Jun 2019 03:56:54 +0000 (+0900) Subject: util: fix sign-compare warning X-Git-Tag: v243-rc1~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8164e30603514a77c2d3aef8ec49a78468ec8563;p=thirdparty%2Fsystemd.git util: fix sign-compare warning --- diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 8ccb4a941a7..434159f41ce 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -267,13 +267,12 @@ static char *format_timestamp_internal( assert(buf); - if (l < - 3 + /* week day */ - 1 + 10 + /* space and date */ - 1 + 8 + /* space and time */ - (us ? 1 + 6 : 0) + /* "." and microsecond part */ - 1 + 1 + /* space and shortest possible zone */ - 1) + if (l < (size_t) (3 + /* week day */ + 1 + 10 + /* space and date */ + 1 + 8 + /* space and time */ + (us ? 1 + 6 : 0) + /* "." and microsecond part */ + 1 + 1 + /* space and shortest possible zone */ + 1)) return NULL; /* Not enough space even for the shortest form. */ if (t <= 0 || t == USEC_INFINITY) return NULL; /* Timestamp is unset */