2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

timeval: Workaround strftime bug in VS 2013.

Visual Studio 2013's behavior is to crash when 0 is passed as second
argument to strftime.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
This commit is contained in:
Gurucharan Shetty
2014-05-12 12:55:24 -07:00
parent 3e94784cb7
commit 2b89438deb

View File

@@ -681,7 +681,9 @@ strftime_msec(char *s, size_t max, const char *format,
{
size_t n;
n = strftime(s, max, format, &tm->tm);
/* Visual Studio 2013's behavior is to crash when 0 is passed as second
* argument to strftime. */
n = max ? strftime(s, max, format, &tm->tm) : 0;
if (n) {
char decimals[4];
char *p;