Merge pull request #940 from lnslbrty/fix/small-and-optimistic-improvments
Fixed CodeInspector issues.
This commit is contained in:
+12
-8
@@ -13,10 +13,18 @@ AS_IF([test "${with_sanitizer+set}" = set],[
|
|||||||
|
|
||||||
LT_INIT
|
LT_INIT
|
||||||
|
|
||||||
AC_PROG_CC(clang gcc)
|
SYSTEM=`uname -s`
|
||||||
AM_PROG_CC_C_O(clang gcc)
|
if test $SYSTEM = "Darwin"; then
|
||||||
AC_PROG_CXX(clang++ g++)
|
AC_PROG_CC(clang gcc)
|
||||||
AC_PROG_CC_STDC(clang gcc)
|
AM_PROG_CC_C_O(clang gcc)
|
||||||
|
AC_PROG_CXX(clang++ g++)
|
||||||
|
AC_PROG_CC_STDC(clang gcc)
|
||||||
|
else
|
||||||
|
AC_PROG_CC
|
||||||
|
AM_PROG_CC_C_O
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_PROG_CC_STDC
|
||||||
|
fi
|
||||||
AC_LANG_WERROR
|
AC_LANG_WERROR
|
||||||
AX_PTHREAD
|
AX_PTHREAD
|
||||||
|
|
||||||
@@ -78,10 +86,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
MACHINE=`uname -m`
|
MACHINE=`uname -m`
|
||||||
SYSTEM=`uname -s`
|
|
||||||
if test $SYSTEM = "Darwin"; then
|
|
||||||
CC=clang
|
|
||||||
fi
|
|
||||||
|
|
||||||
CUSTOM_NDPI=
|
CUSTOM_NDPI=
|
||||||
|
|
||||||
|
|||||||
@@ -118,28 +118,33 @@ int main(int argc, char ** argv)
|
|||||||
|
|
||||||
if (fseek(pcap_file, 0, SEEK_END) != 0) {
|
if (fseek(pcap_file, 0, SEEK_END) != 0) {
|
||||||
perror("fseek(SEEK_END) failed");
|
perror("fseek(SEEK_END) failed");
|
||||||
|
fclose(pcap_file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcap_file_size = ftell(pcap_file);
|
pcap_file_size = ftell(pcap_file);
|
||||||
if (pcap_file_size < 0) {
|
if (pcap_file_size < 0) {
|
||||||
perror("ftell failed");
|
perror("ftell failed");
|
||||||
|
fclose(pcap_file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fseek(pcap_file, 0, SEEK_SET) != 0) {
|
if (fseek(pcap_file, 0, SEEK_SET) != 0) {
|
||||||
perror("fseek(0, SEEK_SET) failed");
|
perror("fseek(0, SEEK_SET) failed");
|
||||||
|
fclose(pcap_file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcap_buffer = malloc(pcap_file_size);
|
pcap_buffer = malloc(pcap_file_size);
|
||||||
if (pcap_buffer == NULL) {
|
if (pcap_buffer == NULL) {
|
||||||
perror("malloc failed");
|
perror("malloc failed");
|
||||||
|
fclose(pcap_file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fread(pcap_buffer, sizeof(*pcap_buffer), pcap_file_size, pcap_file) != pcap_file_size) {
|
if (fread(pcap_buffer, sizeof(*pcap_buffer), pcap_file_size, pcap_file) != pcap_file_size) {
|
||||||
perror("fread failed");
|
perror("fread failed");
|
||||||
|
fclose(pcap_file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ PCAPS=`cd pcap; /bin/ls *.pcap`
|
|||||||
|
|
||||||
fuzzy_testing() {
|
fuzzy_testing() {
|
||||||
if [ -f ../fuzz/fuzz_ndpi_reader ]; then
|
if [ -f ../fuzz/fuzz_ndpi_reader ]; then
|
||||||
../fuzz/fuzz_ndpi_reader -max_total_time=${MAX_TOTAL_TIME:-592} -print_pcs=1 -workers=${FUZZY_WORKERS:-0} -jobs=${FUZZY_JOBS:-0} pcap/
|
../fuzz/fuzz_ndpi_reader -max_total_time="${MAX_TOTAL_TIME:-592}" -print_pcs=1 -workers="${FUZZY_WORKERS:-0}" -jobs="${FUZZY_JOBS:-0}" pcap/
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user