[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: c program : pb with Sparc ?



On Sat, Jan 22, 2000 at 10:24:12AM +0100, Thierry Laronde wrote:
> By the way, can someone tell me before I send a bug report to the upstream
> author, if in an newer version of libc draft (I'm still on slink, and the 
> version is 0.07) the definition of strftime() is corrected, because, if I 
> understand correctly the text, the draft says that strftime() returns the 
> number of chars written, even if there was not enough place in the buffer, 
> and that's wrong : POSIX.1 defines that in this case the funcion returns 0, 
> which is actually the case.

"The size parameter can be used to specify the maximum number of characters
to be stored in the array s, including the terminating null character.  If
the formatted time requires more then size characters, strftime returns
zero and the content of the array s is indetermined[sic].  Otherwise the
return value indicates the number of characters placed in the array s, not
including the terminating null character."

[...]

"If s is a null pointer, strftime does not actually write anything, but
instead returns the number of characters it would have written."

Does that answer your question?

-- 
G. Branden Robinson            |    America is at that awkward stage.  It's
Debian GNU/Linux               |    too late to work within the system, but
branden@ecn.purdue.edu         |    too early to shoot the bastards.
roger.ecn.purdue.edu/~branden/ |    --Claire Wolfe

Attachment: pgpEPvDWnvyyd.pgp
Description: PGP signature


Reply to: