Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XSH asctime()

To: yyyyyyyyyyyyyyy@xxxxxxx
Subject: Re: Defect in XSH asctime()
From: "Clive D.W. Feather" <yyyyy@xxxxxxxxx>
Date: Mon, 15 Dec 2003 11:09:41 +0000
Cc: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
References: <200312120217.CAA12802@xxxxxx>
yyyyyyyyyyyyyyy@xxxxxxx said:
> If asctime() is called with a tm structure whose tm_year field results
> in a year > 9999 (which is possible with 64-bit time_t), the current
> specification of asctime() would result in asctime() to overrunning a
> 26-character buffer;  the specification says the sprintf() format
> for printing the year is "%d", and (eg) a 5-digit number would print
> 5 characters, overrunning the buffer.

WG14 examined this issue quite a long time ago. We decided that the
behaviour was simply undefined. There is no requirement that a particular
string appear in the buffer, or even that the function call returns in a
sensible state (or at all). It's *UNDEFINED*.

-- 
Clive D.W. Feather  | Work:  <yyyyy@xxxxxxxxx>   | Tel:    +44 20 8495 6138
Internet Expert     | Home:  <yyyyy@xxxxxxxxxx>  | *** NOTE CHANGE ***
Demon Internet      | WWW: http://www.davros.org | Fax:    +44 870 051 9937
Thus plc            |                            | Mobile: +44 7973 377646

<Prev in Thread] Current Thread [Next in Thread>