aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-07-24 14:16:38 +0200
committerLuca Deri <deri@ntop.org>2019-07-24 14:16:38 +0200
commit5c6c64ed1d962a564570c84d07f73ce3305804d5 (patch)
tree90a946c75ae3a88b78b0531d0108b78d01004520
parentb99ef159ed551ab5603a3aaa385c1da1bfd4255a (diff)
Warnign fix
-rw-r--r--src/include/ndpi_classify.h2
-rw-r--r--src/lib/ndpi_classify.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/include/ndpi_classify.h b/src/include/ndpi_classify.h
index a33dff752..9b5f2841f 100644
--- a/src/include/ndpi_classify.h
+++ b/src/include/ndpi_classify.h
@@ -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_clear(struct timeval *a);
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 */
diff --git a/src/lib/ndpi_classify.c b/src/lib/ndpi_classify.c
index abaaa08bd..79cf1c234 100644
--- a/src/lib/ndpi_classify.c
+++ b/src/lib/ndpi_classify.c
@@ -658,7 +658,7 @@ ndpi_timeval_to_milliseconds(struct timeval ts)
}
void
-ndpi_log_timestamp(char *log_ts)
+ndpi_log_timestamp(char *log_ts, u_int log_ts_len)
{
struct timeval tv;
time_t nowtime;
@@ -669,5 +669,5 @@ ndpi_log_timestamp(char *log_ts)
nowtime = tv.tv_sec;
localtime_r(&nowtime, &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);
}