Skip to content

main/tig: fix printing of time_t values on 32 bit arches

Sören Tempel requested to merge nmeum/aports:tig-time_t into master

Fixes the following compiler warning:

src/util.c:163:48: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'time_t' {aka 'long long int'} [-Wformat=]
  163 |    if (!string_nformat(buf, buflen, NULL, "%s%ld%c",
      |                                              ~~^
      |                                                |
      |                                                long int
      |                                              %lld
  164 |         now.tv_sec >= timestamp ? "" : "-",
  165 |         seconds, reldate[i].compact_symbol))
      |         ~~~~~~~                                 
      |         |
      |         time_t {aka long long int}
src/util.c:168:52: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t' {aka 'long long int'} [-Wformat=]
  168 |   } else if (!string_nformat(buf, buflen, NULL, "%ld %s%s %s",
      |                                                  ~~^
      |                                                    |
      |                                                    long int
      |                                                  %lld
  169 |         seconds, reldate[i].name,
      |         ~~~~~~~                                     
      |         |
      |         time_t {aka long long int}
Edited by Sören Tempel

Merge request reports