Asctime.c

Andrew Brown atatat at atatdot.net
Thu Jul 22 03:21:02 UTC 2004


>> 	** The format used in the (2004) standard is
>> 	**	"%.3s %.3s%3d %.2d:%.2d:%.2d %d\n"
>> 	** Use "%02d", as it is a bit more portable than "%.2d".
>> 	** Drop each .3 since they're superfluous given how we set wn and
>> mn.
>> 	*/
>> 	(void) sprintf(buf, "%s %s%3d %02d:%02d:%02d %ld\n",
>> 		wn, mn,
>
>It's not correct to drop the two .3's here, since wn and mn might not
>be null terminated: they usually point to arrays of 3 characters that
>are not null-terminated.

might there not also be locale issues here?

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior at daemon.org             * "ah!  i see you have the internet
twofsonet at graffiti.com (Andrew Brown)                that goes *ping*!"
werdna at squooshy.com       * "information is power -- share the wealth."



More information about the tz mailing list