aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2016-11-03 15:39:28 +0100
committerCampus <campus@ntop.org>2016-11-03 15:39:28 +0100
commit58e97c966c3aef178580d8f362df95274fbe9c8a (patch)
tree2276b88ff75811e44d48336c3ee4d1303e297940 /src/lib/ndpi_main.c
parent002b8b04e9ff06aa75a93af4466361636ef38820 (diff)
parente3d15ef4e7f896ca62773cbd9b207967055d96b0 (diff)
Merge branch 'vpiserchia-dev' into dev
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index c6a39394d..c8d2d3d7d 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -1716,7 +1716,10 @@ void set_ndpi_free(void (*__ndpi_free)(void *ptr)) { _ndpi_free = __ndpi_
void set_ndpi_debug_function(struct ndpi_detection_module_struct *ndpi_str, ndpi_debug_function_ptr ndpi_debug_printf) {
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
- ndpi_str->ndpi_debug_printf = ndpi_debug_printf;
+ if (ndpi_debug_printf != NULL)
+ ndpi_str->ndpi_debug_printf = ndpi_debug_printf;
+ else
+ ndpi_str->ndpi_debug_printf = (ndpi_debug_function_ptr) printf;
#endif
}
@@ -1727,7 +1730,7 @@ struct ndpi_detection_module_struct *ndpi_init_detection_module(void) {
if(ndpi_str == NULL) {
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
- ndpi_debug_printf(0, NULL, NDPI_LOG_DEBUG, "ndpi_init_detection_module initial malloc failed\n");
+ printf(0, NULL, NDPI_LOG_DEBUG, "ndpi_init_detection_module initial malloc failed\n");
#endif
return NULL;
}