diff options
author | Luca Deri <deri@ntop.org> | 2022-01-16 12:47:23 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2022-01-16 12:47:56 +0100 |
commit | 42d74171b232686d00157dd6b0dcbb81da7ae620 (patch) | |
tree | de6042046a1f2e8c90079c8db1495cfd4fe3b4fb | |
parent | dd325248f1b2eaad902c340f415d1ab76332e79c (diff) |
Minor cosmetic changes
-rw-r--r-- | example/ndpiReader.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index a84f1e0d0..c84e88fcd 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -878,13 +878,13 @@ static void parseOptions(int argc, char **argv) { if(nDPI_LogLevel > NDPI_LOG_DEBUG_EXTRA) { nDPI_LogLevel = NDPI_LOG_DEBUG_EXTRA; ndpi_free(_debug_protocols); - _debug_protocols = strdup("all"); + _debug_protocols = ndpi_strdup("all"); } break; case 'u': ndpi_free(_debug_protocols); - _debug_protocols = strdup(optarg); + _debug_protocols = ndpi_strdup(optarg); break; case 'h': @@ -923,7 +923,7 @@ static void parseOptions(int argc, char **argv) { break; case 'w': - results_path = strdup(optarg); + results_path = ndpi_strdup(optarg); if((results_file = fopen(results_path, "w")) == NULL) { printf("Unable to write in file %s: quitting\n", results_path); return; @@ -959,7 +959,7 @@ static void parseOptions(int argc, char **argv) { #endif case '7': - extcap_capture_fifo = strdup(optarg); + extcap_capture_fifo = ndpi_strdup(optarg); break; case '9': @@ -3762,8 +3762,8 @@ void automataUnitTest() { void *automa = ndpi_init_automa(); assert(automa); - assert(ndpi_add_string_to_automa(automa, strdup("hello")) == 0); - assert(ndpi_add_string_to_automa(automa, strdup("world")) == 0); + assert(ndpi_add_string_to_automa(automa, ndpi_strdup("hello")) == 0); + assert(ndpi_add_string_to_automa(automa, ndpi_strdup("world")) == 0); ndpi_finalize_automa(automa); assert(ndpi_match_string(automa, "This is the wonderful world of nDPI") == 1); ndpi_free_automa(automa); @@ -4203,7 +4203,7 @@ void desUnitTest() { if(trace) { printf("%2u)\t%12.3f\t%.3f\t%12.3f\t%12.3f\t %s [%.3f]\n", i, v[i], prediction, lower, upper, - ((rc == 0) || ((v[i] >= lower) && (v[i] <= upper))) ? "OK" : "ANOMALY", + (rc == 0) ? "LEARNING" : (((v[i] >= lower) && (v[i] <= upper)) ? "OK" : "ANOMALY"), confidence_band); if(fd) |