winsup/cygwin/libc/strptime.cc(__strptime) fix %F width
This commit is contained in:
parent
4dfaef8141
commit
d8e2463c75
|
@ -413,13 +413,15 @@ literal:
|
||||||
case 'F': /* The date as "%Y-%m-%d". */
|
case 'F': /* The date as "%Y-%m-%d". */
|
||||||
{
|
{
|
||||||
LEGAL_ALT(0);
|
LEGAL_ALT(0);
|
||||||
ymd |= SET_YMD;
|
|
||||||
char *tmp = __strptime ((const char *) bp, "%Y-%m-%d",
|
char *tmp = __strptime ((const char *) bp, "%Y-%m-%d",
|
||||||
tm, era_info, alt_digits,
|
tm, era_info, alt_digits,
|
||||||
locale);
|
locale);
|
||||||
if (tmp && (uint) (tmp - (char *) bp) > width)
|
/* width max chars converted, default 10, < 6 => 6 */
|
||||||
|
if (tmp && (char *) bp +
|
||||||
|
(!width ? 10 : width < 6 ? 6 : width) < tmp)
|
||||||
return NULL;
|
return NULL;
|
||||||
bp = (const unsigned char *) tmp;
|
bp = (const unsigned char *) tmp;
|
||||||
|
ymd |= SET_YMD;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue