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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user