diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/Makefile.in | 3 | ||||
-rw-r--r-- | example/ndpiReader.c | 3 | ||||
-rw-r--r-- | example/ndpi_util.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/example/Makefile.in b/example/Makefile.in index bf218f503..074718028 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -22,6 +22,9 @@ install: dpdk: make -f Makefile.dpdk +check: + cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I../src/include -I/usr/local/include/json-c *.c + clean: /bin/rm -f *.o ndpiReader ndpiReader.dpdk /bin/rm -f .*.dpdk.cmd .*.o.cmd *.dpdk.map .*.o.d diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 8996ea1a5..e30df41f9 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1018,7 +1018,6 @@ void freeIpTree(addr_node *root) { freeIpTree(root->left); freeIpTree(root->right); free(root); - root = NULL; } /* *********************************************** */ @@ -2904,7 +2903,7 @@ float getAverage(struct json_object *jObj_stat, char *field){ float average; float sum = 0; int r; - int j; + int j = 0; if((r = strcmp(field, "top.scanner.stats")) == 0) { for(j=0; j<json_object_array_length(jObj_stat); j++) { diff --git a/example/ndpi_util.c b/example/ndpi_util.c index 58dc896b1..3a2a66c97 100644 --- a/example/ndpi_util.c +++ b/example/ndpi_util.c @@ -1044,7 +1044,7 @@ iph_check: static uint32_t crc32_for_byte(uint32_t r) { int j; for(j = 0; j < 8; ++j) - r = (r & 1? 0: (uint32_t)0xEDB88320L) ^ r >> 1; + r = ((r & 1) ? 0 : (uint32_t)0xEDB88320L) ^ r >> 1; return r ^ (uint32_t)0xFF000000L; } |