Warnign fix
This commit is contained in:
@@ -87,6 +87,6 @@ unsigned int ndpi_timer_lt(const struct timeval *a, const struct timeval *b);
|
|||||||
void ndpi_timer_sub(const struct timeval *a, const struct timeval *b, struct timeval *result);
|
void ndpi_timer_sub(const struct timeval *a, const struct timeval *b, struct timeval *result);
|
||||||
void ndpi_timer_clear(struct timeval *a);
|
void ndpi_timer_clear(struct timeval *a);
|
||||||
unsigned int ndpi_timeval_to_milliseconds(struct timeval ts);
|
unsigned int ndpi_timeval_to_milliseconds(struct timeval ts);
|
||||||
void ndpi_log_timestamp(char *log_ts);
|
void ndpi_log_timestamp(char *log_ts, u_int log_ts_len);
|
||||||
|
|
||||||
#endif /* NDPI_CLASSIFY_H */
|
#endif /* NDPI_CLASSIFY_H */
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ ndpi_timeval_to_milliseconds(struct timeval ts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ndpi_log_timestamp(char *log_ts)
|
ndpi_log_timestamp(char *log_ts, u_int log_ts_len)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
time_t nowtime;
|
time_t nowtime;
|
||||||
@@ -669,5 +669,5 @@ ndpi_log_timestamp(char *log_ts)
|
|||||||
nowtime = tv.tv_sec;
|
nowtime = tv.tv_sec;
|
||||||
localtime_r(&nowtime, &nowtm_r);
|
localtime_r(&nowtime, &nowtm_r);
|
||||||
strftime(tmbuf, NDPI_TIMESTAMP_LEN, "%H:%M:%S", &nowtm_r);
|
strftime(tmbuf, NDPI_TIMESTAMP_LEN, "%H:%M:%S", &nowtm_r);
|
||||||
snprintf(log_ts, NDPI_TIMESTAMP_LEN, "%s.%06ld", tmbuf, (long)tv.tv_usec);
|
snprintf(log_ts, log_ts_len, "%s.%06ld", tmbuf, (long)tv.tv_usec);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user