| 440 | } |
| 441 | |
| 442 | const char *show_ident_date(const struct ident_split *ident, |
| 443 | struct date_mode mode) |
| 444 | { |
| 445 | timestamp_t date = 0; |
| 446 | long tz = 0; |
| 447 | |
| 448 | if (ident->date_begin && ident->date_end) |
| 449 | date = parse_timestamp(ident->date_begin, NULL, 10); |
| 450 | if (date_overflows(date)) |
| 451 | date = 0; |
| 452 | else { |
| 453 | if (ident->tz_begin && ident->tz_end) |
| 454 | tz = strtol(ident->tz_begin, NULL, 10); |
| 455 | if (tz >= INT_MAX || tz <= INT_MIN) |
| 456 | tz = 0; |
| 457 | } |
| 458 | return show_date(date, tz, mode); |
| 459 | } |
| 460 | |
| 461 | static inline void strbuf_add_with_color(struct strbuf *sb, const char *color, |
| 462 | const char *buf, size_t buflen) |
no test coverage detected