diff options
author | pettai <pettai@pkgsrc.org> | 2012-01-02 07:35:22 +0000 |
---|---|---|
committer | pettai <pettai@pkgsrc.org> | 2012-01-02 07:35:22 +0000 |
commit | 5336a22a203c68fbd021824546a97b48a7b47c14 (patch) | |
tree | 16bb6eeeb8695621b8e692ed68a03b88e501e191 /net/ldns | |
parent | eee4cd31728814bb6b07f94a5bce7e23a6e9a213 (diff) | |
download | pkgsrc-5336a22a203c68fbd021824546a97b48a7b47c14.tar.gz |
Fixes the bug in ldns_year_and_yday_from_days_since_epoch on 32-bit OSes
http://open.nlnetlabs.nl/pipermail/ldns-users/2011-December/000452.html
(patch taken from trunk)
(ok'ed by wiz@)
Diffstat (limited to 'net/ldns')
-rw-r--r-- | net/ldns/Makefile | 3 | ||||
-rw-r--r-- | net/ldns/distinfo | 3 | ||||
-rw-r--r-- | net/ldns/patches/patch-util.c | 20 |
3 files changed, 24 insertions, 2 deletions
diff --git a/net/ldns/Makefile b/net/ldns/Makefile index 921660d7ab0..26eceb2fd07 100644 --- a/net/ldns/Makefile +++ b/net/ldns/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.19 2011/10/22 19:44:54 he Exp $ +# $NetBSD: Makefile,v 1.20 2012/01/02 07:35:22 pettai Exp $ DISTNAME= ldns-1.6.11 +PKGREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.nlnetlabs.nl/downloads/ldns/ diff --git a/net/ldns/distinfo b/net/ldns/distinfo index 0309b617801..71456f1ac4f 100644 --- a/net/ldns/distinfo +++ b/net/ldns/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.11 2011/10/22 19:44:54 he Exp $ +$NetBSD: distinfo,v 1.12 2012/01/02 07:35:22 pettai Exp $ SHA1 (ldns-1.6.11.tar.gz) = 2c4537eee39a1af63e8dde4f35498ce78c968c1f RMD160 (ldns-1.6.11.tar.gz) = 7580869e4b8bdd2d31cb08cb690c2e3d0663f381 Size (ldns-1.6.11.tar.gz) = 1018369 bytes +SHA1 (patch-util.c) = 7286524906313059684c287729ddca78bf0e0d5d diff --git a/net/ldns/patches/patch-util.c b/net/ldns/patches/patch-util.c new file mode 100644 index 00000000000..25be065d229 --- /dev/null +++ b/net/ldns/patches/patch-util.c @@ -0,0 +1,20 @@ +$NetBSD: patch-util.c,v 1.1 2012/01/02 07:35:22 pettai Exp $ + +Fixes the bug in ldns_year_and_yday_from_days_since_epoch on 32-bit OSes +http://open.nlnetlabs.nl/pipermail/ldns-users/2011-December/000452.html +(patch taken from trunk) + +--- util.c.orig 2012-01-01 23:16:59.000000000 +0000 ++++ util.c +@@ -256,10 +256,7 @@ ldns_year_and_yday_from_days_since_epoch + int new_year; + + while (days < 0 || days >= (int64_t) (is_leap_year(year) ? 366 : 365)) { +- new_year = year + (int) LDNS_DIV(days, 366); +- if (year == new_year) { +- year += days < 0 ? -1 : 1; +- } ++ new_year = year + (int) LDNS_DIV(days, 365); + days -= (new_year - year) * 365; + days -= leap_days(year, new_year); + year = new_year; |