[Bug 212983] strptime(3) doesn't increment pointer on parsing '%w' (weekday)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Sep 25 10:58:47 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212983
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 at FreeBSD.org
Reporter: grembo at FreeBSD.org
Created attachment 175152
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=175152&action=edit
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.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list