Date: Sun, 25 Sep 2016 10:58:47 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212983] strptime(3) doesn't increment pointer on parsing '%w' (weekday) Message-ID: <bug-212983-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212983 Bug ID: 212983 Summary: strptime(3) doesn't increment pointer on parsing '%w' (weekday) Product: Base System Version: 11.0-RC1 Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: grembo@FreeBSD.org Created attachment 175152 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D175152&action= =3Dedit Patch to increment buf on parsing 'w' strptime has a long standing bug that makes it fail to parse "%w" properly. E.g.: printf("%s", strptime("1970/01/01 00:00:00 4 UTC 123", "%Y/%m/%d %T %w UTC", &tm)); Expected output: 123 Actual output: 4123 or printf("%i", (int)strptime("4 1970", "%w %Y", &tm)); Expected output: Something >0 Actual output: 0 The attached patch aims to fix this problem. Thanks to Nikola Kolev for reporting this problem. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212983-8>