Commit c583c4af authored by Vijay Kiran Kamuju's avatar Vijay Kiran Kamuju Committed by Alexandre Julliard

msvcrt: Implement %n and %t formats for strftime.

parent 90e520b4
......@@ -634,11 +634,21 @@ static void test_strftime(void)
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
errno = 0xdeadbeef;
retA = p_strftime(bufA, 256, "%n", gmt_tm);
ok(retA == 0, "expected 0, got %ld\n", retA);
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
errno = 0xdeadbeef;
retA = p_strftime(bufA, 256, "%R", gmt_tm);
ok(retA == 0, "expected 0, got %ld\n", retA);
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
errno = 0xdeadbeef;
retA = p_strftime(bufA, 256, "%t", gmt_tm);
ok(retA == 0, "expected 0, got %ld\n", retA);
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
errno = 0xdeadbeef;
retA = p_strftime(bufA, 256, "%T", gmt_tm);
ok(retA == 0, "expected 0, got %ld\n", retA);
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
......
......@@ -1225,6 +1225,11 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f
if(!strftime_int(str, &ret, max, mstm->tm_min, alternate ? 0 : 2, 0, 59))
return 0;
break;
#if _MSVCR_VER>=140
case 'n':
str[ret++] = '\n';
break;
#endif
case 'p':
if(mstm->tm_hour<0 || mstm->tm_hour>23)
goto einval_error;
......@@ -1247,6 +1252,9 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f
return 0;
break;
#if _MSVCR_VER>=140
case 't':
str[ret++] = '\t';
break;
case 'T':
if(!strftime_int(str, &ret, max, mstm->tm_hour, alternate ? 0 : 2, 0, 23))
return 0;
......
......@@ -942,6 +942,14 @@ static void test_strftime(void)
retA = p_strftime(bufA, sizeof(bufA), "%h", &epoch);
ok(retA == 3, "expected 3, got %d\n", (int)retA);
ok(!strcmp(bufA, "Jan"), "got %s\n", bufA);
retA = p_strftime(bufA, sizeof(bufA), "%n", &epoch);
ok(retA == 1, "expected 1, got %d\n", (int)retA);
ok(!strcmp(bufA, "\n"), "got %s\n", bufA);
retA = p_strftime(bufA, sizeof(bufA), "%t", &epoch);
ok(retA == 1, "expected 1, got %d\n", (int)retA);
ok(!strcmp(bufA, "\t"), "got %s\n", bufA);
}
static LONG* get_failures_counter(HANDLE *map)
......
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