From c0086fafefc7fd10551b16ccd683dddd1ceab80523b0e17a6f6d7b608b52608b Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 21 Nov 2024 23:29:13 +0300 Subject: [PATCH] Fix awful typo error --- cyac/lib/dec.c | 2 +- gyac/dec.go | 2 +- pyac/pyac.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cyac/lib/dec.c b/cyac/lib/dec.c index 2bdc739..e7effca 100644 --- a/cyac/lib/dec.c +++ b/cyac/lib/dec.c @@ -243,7 +243,7 @@ YACAtomDecode( // NOLINT(misc-no-recursion) } if (l > 8) { v = yacFromBE(buf + 1 + 8, 4); - if ((l == 8) && (v == 0)) { + if ((l == 12) && (v == 0)) { return YACErrTAI64NonMinimal; } if (v > 999999999) { diff --git a/gyac/dec.go b/gyac/dec.go index 7c4d825..3c94d73 100644 --- a/gyac/dec.go +++ b/gyac/dec.go @@ -283,7 +283,7 @@ func AtomDecode(buf []byte) (item *Item, off int, err error) { } if l > 8 { nsecs := FromBE(buf[1+8 : 1+8+4]) - if l == 8 && nsecs == 0 { + if l == 12 && nsecs == 0 { err = errors.New("non-minimal TAI64N") return } diff --git a/pyac/pyac.py b/pyac/pyac.py index bac693c..5d9a0b2 100755 --- a/pyac/pyac.py +++ b/pyac/pyac.py @@ -298,7 +298,7 @@ def loads(v, sets=False, leapsecUTCAllow=False): nsecs = 0 if l > 8: nsecs = int.from_bytes(v[1+8:1+8+4], "big") - if (l == 8) and (nsecs == 0): + if (l == 12) and (nsecs == 0): raise DecodeError("non-minimal TAI64N") if nsecs > 999999999: raise DecodeError("too many nanoseconds") -- 2.48.1