Date: Mon, 08 Oct 2018 14:47:22 +0000 From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 232072] Parsing error with format "%d" in strptime(3) Message-ID: <bug-232072-99@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232072 Bug ID: 232072 Summary: Parsing error with format "%d" in strptime(3) Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: standards Assignee: standards@FreeBSD.org Reporter: miguel_tete17@hotmail.com the format "%d" in the c function strptime(3) does not conform to what the documentation says (https://www.freebsd.org/cgi/man.cgi?query=strptime&sektion=3&manpath=freebsd-release-ports) It is supposed to allow numbers between "01" and "31" but it also allows "00". I am not sure if it is a bug or just the FreeBSD way of doing this function. To my knowledge GNU has the fore mentioned behaviour. Small c++ code to reproduce the error: ######################################################## #include<iostream> #include<ctime> int main() { struct tm tm; if(strptime("00", "%d", &tm)) { std::cout << "WRONG" << std::endl; } else { std::cout << "OK" << std::endl; } } ######################################################## just execute clang++ main.cpp && ./a.out EXPECTED: OK GOT: WRONG -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-232072-99>
