dovecot/dovecot-2.3.13-bigtvsec.patch

37 lines
1.6 KiB
Diff

diff -up dovecot-2.3.13/src/lib/test-time-util.c.bigtvsec dovecot-2.3.13/src/lib/test-time-util.c
--- dovecot-2.3.13/src/lib/test-time-util.c.bigtvsec 2021-01-06 11:27:06.793315308 +0100
+++ dovecot-2.3.13/src/lib/test-time-util.c 2021-01-06 11:27:06.815315088 +0100
@@ -358,7 +358,7 @@ static void test_str_to_timeval(void)
{
struct {
const char *str;
- unsigned int tv_sec, tv_usec;
+ long int tv_sec, tv_usec;
} tests[] = {
{ "0", 0, 0 },
{ "0.0", 0, 0 },
diff -up dovecot-2.3.13/src/lib/time-util.c.bigtvsec dovecot-2.3.13/src/lib/time-util.c
--- dovecot-2.3.13/src/lib/time-util.c.bigtvsec 2021-01-06 11:10:49.791094852 +0100
+++ dovecot-2.3.13/src/lib/time-util.c 2021-01-06 11:10:08.255501319 +0100
@@ -43,16 +43,16 @@ int timeval_cmp_margin(const struct time
if (tv1->tv_sec < tv2->tv_sec) {
sec_margin = ((int)usec_margin / 1000000) + 1;
- if ((tv2->tv_sec - tv1->tv_sec) > sec_margin)
+ if (((long long)tv2->tv_sec - tv1->tv_sec) > sec_margin)
return -1;
- usecs_diff = (tv2->tv_sec - tv1->tv_sec) * 1000000LL +
+ usecs_diff = ((long long)tv2->tv_sec - tv1->tv_sec) * 1000000LL +
(tv2->tv_usec - tv1->tv_usec);
ret = -1;
} else if (tv1->tv_sec > tv2->tv_sec) {
sec_margin = ((int)usec_margin / 1000000) + 1;
- if ((tv1->tv_sec - tv2->tv_sec) > sec_margin)
+ if (((long long)tv1->tv_sec - tv2->tv_sec) > sec_margin)
return 1;
- usecs_diff = (tv1->tv_sec - tv2->tv_sec) * 1000000LL +
+ usecs_diff = ((long long)tv1->tv_sec - tv2->tv_sec) * 1000000LL +
(tv1->tv_usec - tv2->tv_usec);
ret = 1;
} else if (tv1->tv_usec < tv2->tv_usec) {