]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Fix time_t handling in parsing F5 session timeout
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 19 May 2023 11:06:28 +0000 (12:06 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 19 May 2023 11:07:56 +0000 (12:07 +0100)
commiteb890eb98477fde872daa27cc56e89c0b3e31f6a
tree57e328ed9dc21e6344615593ac9c2b03b4e568ca
parent8820b0a65384b1f0d7c68c53fcd1f9296a7a5442
Fix time_t handling in parsing F5 session timeout

We can't assume that time_t is 'long'. When building for win64 we get:
../f5.c: In function 'f5_configure':
../f5.c:690:63: warning: format '%ld' expects argument of type 'long int *', but argument 6 has type 'time_t *' {aka 'long long int *'} [-Wformat=]
  690 |                         if (sscanf(cookie->value, "%dz%dz%dz%ldz%ld%c", &junk, &junk, &junk, &start, &dur, &c) >= 5
      |                                                             ~~^                              ~~~~~~
      |                                                               |                              |
      |                                                               long int *                     time_t * {aka long long int *}
      |                                                             %lld
../f5.c:690:67: warning: format '%ld' expects argument of type 'long int *', but argument 7 has type 'time_t *' {aka 'long long int *'} [-Wformat=]
  690 |                         if (sscanf(cookie->value, "%dz%dz%dz%ldz%ld%c", &junk, &junk, &junk, &start, &dur, &c) >= 5
      |                                                                 ~~^                                  ~~~~
      |                                                                   |                                  |
      |                                                                   long int *                         time_t * {aka long long int *}
      |                                                                 %lld

Make it explicitly 'unsigned long long' instead.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
f5.c