diff options
Diffstat (limited to '')
-rw-r--r-- | src/libnetdata/datetime/rfc3339.c (renamed from libnetdata/datetime/rfc3339.c) | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libnetdata/datetime/rfc3339.c b/src/libnetdata/datetime/rfc3339.c index 157e340d3..5c4e990dd 100644 --- a/libnetdata/datetime/rfc3339.c +++ b/src/libnetdata/datetime/rfc3339.c @@ -27,7 +27,7 @@ size_t rfc3339_datetime_ut(char *buffer, size_t len, usec_t now_ut, size_t fract return 0; } - if (fractional_digits >= 0 && fractional_digits <= 9) { + if (fractional_digits >= 1 && fractional_digits <= 9) { int fractional_part = (int)(now_ut % USEC_PER_SEC); if (fractional_part && len - used_length > fractional_digits + 1) { char format[] = ".%01d"; @@ -102,8 +102,8 @@ usec_t rfc3339_parse_ut(const char *rfc3339, char **endptr) { if (*s == '+' || *s == '-') { // Parse the hours:mins part of the timezone - if (!isdigit(s[1]) || !isdigit(s[2]) || s[3] != ':' || - !isdigit(s[4]) || !isdigit(s[5])) + if (!isdigit((uint8_t)s[1]) || !isdigit((uint8_t)s[2]) || s[3] != ':' || + !isdigit((uint8_t)s[4]) || !isdigit((uint8_t)s[5])) return 0; // Parsing error char tz_sign = *s; |