tom petch wrote:
I would expect the index to be [0, 'typecnt'-1) or [1, 'typecnt') but not [0, 'typecnt') as the I-D says, unless zero has a special meaning but then it is not really an index.
Alhough the [lo, hi) notation is well-established (as Tim Parenti mentioned), it wouldn't hurt to reword this to [0, 'typecnt'-1] to avoid the confusion you ran into.
I infer, and would rather be told explicitly, that "The total number of octets is specified by the 'charcnt' field .. excludes the NUL that terminates the list.
charcnt includes the NUL; it does not exclude it. Since you inferred otherwise we should make this explicit. Also, come to think of it, we should say that charcnt MUST NOT be zero, as this constraint (which is a logical implication of the already-documented constraint that typecnt must not be zero) will help avoid further confusion in this area.
In s.1, "the source the time zone data metadata, identifiers, ..." would appear to be light of an 'of'.
Thanks, good catch. Proposed patch attached. It attempts to address all the above issues.
--- draft-murchison-tzdist-tzif-14.xml 2018-09-13 11:08:37.082278967 -0700 +++ draft-murchison-tzdist-tzif-14-01.xml 2018-09-13 11:27:43.484884588 -0700 @@ -118,7 +118,7 @@ <t>This specification does not define the source of leap second - information, nor does it define the source the time zone + information, nor does it define the source of the time zone data, metadata, identifiers, aliases, localized names, or versions as defined in Section 3 of <xref target='RFC7808'/>. One such source is the IANA-hosted time zone database <xref @@ -379,7 +379,9 @@ <t hangText="charcnt:"> A four-octet unsigned integer specifying the total number of octets used by the set of time zone designations - contained in the data block. + contained in the data block - MUST NOT be zero. + The count includes the trailing NUL (0x00) octet at the + end of the last time zone designation. </t> </list> </t> @@ -448,7 +450,7 @@ type records. The number of type indices is specified by the 'timecnt' field in the header. - Each type index MUST be in the range [0, 'typecnt'). + Each type index MUST be in the range [0, 'typecnt'-1]. </t> <t hangText="local time type records:"> A series of six-octet records specifying a local time @@ -490,7 +492,7 @@ A one-octet unsigned integer specifying an index into the series of time zone designation octets, thereby selecting a particular designation string. - Each index MUST be in the range [0, 'charcnt'), and + Each index MUST be in the range [0, 'charcnt'-1], and MUST index a NUL-terminated (0x00) sequence of octets. </t>