Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- dlls/msvcrt/tests/time.c | 5 +++++ dlls/msvcrt/time.c | 3 +++ dlls/ucrtbase/tests/misc.c | 4 ++++ 3 files changed, 12 insertions(+)
diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 9795c92baf8..7eea78367db 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -628,6 +628,11 @@ static void test_strftime(void) 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, "%h", 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); diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index cbffd77f32e..6108ad17cce 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1142,6 +1142,9 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f return 0; break; case 'b': +#if _MSVCR_VER>=140 + case 'h': +#endif if(mstm->tm_mon<0 || mstm->tm_mon>11) goto einval_error; if(!strftime_str(str, &ret, max, time_data->str.names.short_mon[mstm->tm_mon])) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index aecbc9dca52..f902b5dde5d 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -938,6 +938,10 @@ static void test_strftime(void) retA = p_strftime(bufA, sizeof(bufA), "%#T", &epoch); ok(retA == 5, "expected 5, got %d\n", (int)retA); ok(!strcmp(bufA, "0:0:0"), "got %s\n", bufA); + + 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); }
static LONG* get_failures_counter(HANDLE *map)