Am 13.12.18 um 08:46 schrieb "[email protected]" via curl-library:

Lib\spray.c
  if(compare(i, t->key) < 0) {  <====== never become negative
    /* even the smallest is too big */
    *removed = NULL;
    return t;
  }

https://github.com/curl/curl/issues/2004
The loop happens on systems where time_t is defined to an unsigned type (e.g. QNX).
Differences between unsigned types will never become negative.

I assume that you are referring to lib/splay.c. compare() is a macro which resolves to another macro Curl_splaycomparekeys() from lib/splay.h:

#define Curl_splaycomparekeys(i,j) ( ((i.tv_sec)  < (j.tv_sec)) ? -1 : \
                                   ( ((i.tv_sec)  > (j.tv_sec)) ?  1 : \
                                   ( ((i.tv_usec) < (j.tv_usec)) ? -1 : \
( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0))))

So compare() can indeed return a value less than zero.

--
Stephan


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to