Commit bb3c3e8f authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

ucrtbase: Correct day-of-week range for strftime.

parent bcb1aee8
......@@ -1405,6 +1405,8 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max,
return 0;
break;
case 'u':
if(!MSVCRT_CHECK_PMT(mstm->tm_wday>=0 && mstm->tm_wday<=6))
goto einval_error;
tmp = mstm->tm_wday ? mstm->tm_wday : 7;
if(!strftime_int(str, &ret, max, tmp, 0, 1, 7))
return 0;
......
......@@ -959,11 +959,11 @@ static void test_strftime(void)
{"%#R", "0:0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
{"%T", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
{"%#T", "0:0:0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
{"%u", "", { 0, 0, 0, 1, 0, 117, -1, 0, 0 }, FALSE, TRUE},
{"%u", "", { 0, 0, 0, 1, 0, 117, -1, 0, 0 }},
{"%u", "7", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }},
{"%u", "1", { 0, 0, 0, 1, 0, 117, 1, 0, 0 }},
{"%u", "6", { 0, 0, 0, 1, 0, 117, 6, 0, 0 }},
{"%u", "", { 0, 0, 0, 1, 0, 117, 7, 0, 0 }, TRUE},
{"%u", "", { 0, 0, 0, 1, 0, 117, 7, 0, 0 }},
{"%h", "Jan", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
{"%I", "", { 0, 0, -1, 1, 0, 70, 4, 0, 0 }},
{"%I", "12", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment