if (type != REC_VERS) {
*err = WTAP_ERR_BAD_FILE;
- *err_info = g_strdup_printf("ngsniffer: Sniffer file doesn't start with a version record");
+ *err_info = g_strdup("ngsniffer: Sniffer file doesn't start with a version record");
return WTAP_OPEN_ERROR;
}
tm.tm_year = ((start_date&DOS_YEAR_MASK)>>DOS_YEAR_SHIFT) + DOS_YEAR_OFFSET;
tm.tm_mon = ((start_date&DOS_MONTH_MASK)>>DOS_MONTH_SHIFT) + DOS_MONTH_OFFSET;
tm.tm_mday = ((start_date&DOS_DAY_MASK)>>DOS_DAY_SHIFT);
+ /*
+ * The time does not appear to act as an offset; only the date.
+ * XXX - sometimes it does appear to act as an offset; is this
+ * version-dependent?
+ */
#if 0
- /* The time does not appear to act as an offset; only the date */
start_time = pletoh16(&version.time);
tm.tm_hour = (start_time&0xf800)>>11;
tm.tm_min = (start_time&0x7e0)>>5;
tm.tm_sec = (start_time&0x1f)<<1;
-#endif
+#else
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
+#endif
tm.tm_isdst = -1;
ngsniffer->start = mktime(&tm);
/*
* There's not enough data to compare.
*/
*err = WTAP_ERR_UNSUPPORTED;
- *err_info = g_strdup_printf("ngsniffer: WAN capture has too-short protocol list");
+ *err_info = g_strdup("ngsniffer: WAN capture has too-short protocol list");
return -1;
}
*err_info = g_strdup("ngsniffer: Record length is less than packet size");
return -1;
}
+ /*
+ * The maximum value of length is 65535, which is less than
+ * WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check
+ * it.
+ */
if (padding != NULL) {
/*