Date: Thu, 2 Dec 1999 04:10:02 -0800 (PST) From: Sheldon Hearn <sheldonh@uunet.co.za> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/13901: strptime breaks when handling some numerical fields Message-ID: <199912021210.EAA53155@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/13901; it has been noted by GNATS. From: Sheldon Hearn <sheldonh@uunet.co.za> To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: bin/13901: strptime breaks when handling some numerical fields Date: Thu, 02 Dec 1999 14:05:43 +0200 This How-To-Repeat is more visually effective. :-) Ciao, Sheldon. #include <stdio.h> #include <time.h> struct tm t1, t2, t3; int main(void) { strptime("19990823", "%Y%m%d", &t1); /* fails */ strptime("0711", "%m%d", &t2); /* fails */ strptime("199911", "%Y11", &t3); /* fails */ printf("19990823 -> %%Y%%m%%d:\n" "tm_year == %d\n" "tm_mon == %d\n" "tm_mday == %d\n\n", t1.tm_year, t1.tm_mon, t1.tm_mday); printf(" 0711 -> %%m%%d:\n" "tm_mon == %d\n" "tm_mday == %d\n\n", t2.tm_mon, t2.tm_mday); printf(" 199911 -> %%Y11:\n" "tm_year == %d\n", t3.tm_year); return 0; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912021210.EAA53155>