g_snprintf(time_string_buf, 20, "%lu%s", (unsigned long)timer, lf);
return time_string_buf;
} else {
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling localtime(), and thus ctime(), on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
struct tm *tmp;
gchar *buf = g_malloc(16);
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling localtime() on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
const char *zonename = "???";
gchar *buf = NULL;
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling localtime() on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
const char *zonename = "???";
gchar *buf = NULL;
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling localtime() on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
{
struct tm *ti_tm;
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling localtime() on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
guint ns;
guint ms;
gboolean ret;
+ struct tm *tmp;
str_enc = NULL;
for(i=0; encaps[i].s; i++) {
ms = phdr->ts.nsecs / 1000000;
ns = (phdr->ts.nsecs - (1000000*ms))/1000;
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling gmtime() on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
if (phdr->ts.secs > 2000000000)
- g_snprintf(p, 90, "+---------+---------------+----------+\r\nXX:XX:XX,");
+ tmp = NULL;
else
#endif
- strftime(p, 90, "+---------+---------------+----------+\r\n%H:%M:%S,",
- gmtime(&phdr->ts.secs));
+ tmp = gmtime(&phdr->ts.secs);
+ if (tmp == NULL)
+ g_snprintf(p, 90, "+---------+---------------+----------+\r\nXX:XX:XX,");
+ else
+ strftime(p, 90, "+---------+---------------+----------+\r\n%H:%M:%S,", tmp);
wl = strlen(p);
p += wl;
left -= wl;
date. */
if (ngsniffer->first_frame) {
ngsniffer->first_frame=FALSE;
-#ifdef _MSC_VER
+#if (defined _WIN32) && (_MSC_VER < 1500)
/* calling localtime() on MSVC 2005 with huge values causes it to crash */
/* XXX - find the exact value that still does work */
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */