(/home/sate/Testcases/c/cve/wireshark-1.2.0/tshark.c) |
| |
| 2833 | | | print_packet(capture_file *cf, epan_dissect_t *edt) |
| 2834 | | | { |
| 2835 | | | print_args_t print_args; |
| 2836 | | | |
| 2837 | | | if (verbose) { |
| 2838 | | | |
| 2839 | | | switch (output_action) { |
| 2840 | | | |
| 2841 | | | case WRITE_TEXT: |
| 2842 | | | print_args.to_file = TRUE; |
| 2843 | | | print_args.format = print_format; |
| 2844 | | | print_args.print_summary = !verbose; |
Redundant Condition
!verbose always evaluates to false. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that !verbose cannot be true.
- A crashing bug occurs on every path where !verbose could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 2845 | | | print_args.print_hex = verbose && print_hex; |
| 2846 | | | print_args.print_formfeed = FALSE; |
| 2847 | | | print_args.print_dissections = verbose ? print_dissections_expanded : print_dissections_none; |
| 2848 | | | |
| 2849 | | | |
| 2850 | | | packet_range_init(&print_args.range); |
| 2851 | | | |
| 2852 | | | if (!proto_tree_print(&print_args, edt, print_stream)) |
| 2853 | | | return FALSE; |
| 2854 | | | if (!print_hex) { |
| 2855 | | | |
| 2856 | | | |
| 2857 | | | |
| 2858 | | | if (!print_line(print_stream, 0, "")) |
| 2859 | | | return FALSE; |
| 2860 | | | } |
| 2861 | | | break; |
| 2862 | | | |
| 2863 | | | case WRITE_XML: |
| 2864 | | | proto_tree_write_pdml(edt, stdout); |
| 2865 | | | printf("\n"); |
| 2866 | | | return !ferror(stdout); |
| 2867 | | | case WRITE_FIELDS: |
| 2868 | | | proto_tree_write_fields(output_fields, edt, stdout); |
| 2869 | | | printf("\n"); |
| 2870 | | | return !ferror(stdout); |
| 2871 | | | } |
| 2872 | | | } else { |
| 2873 | | | |
| 2874 | | | epan_dissect_fill_in_columns(edt); |
| 2875 | | | |
| 2876 | | | |
| 2877 | | | switch (output_action) { |
| 2878 | | | |
| 2879 | | | case WRITE_TEXT: |
| 2880 | | | if (!print_columns(cf)) |
| 2881 | | | return FALSE; |
| 2882 | | | break; |
| 2883 | | | |
| 2884 | | | case WRITE_XML: |
| 2885 | | | proto_tree_write_psml(edt, stdout); |
| 2886 | | | return !ferror(stdout); |
| 2887 | | | case WRITE_FIELDS: |
| 2888 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 2889 | | | break; |
| 2890 | | | } |
| 2891 | | | } |
| 2892 | | | if (print_hex) { |
| 2893 | | | if (!print_hex_data(print_stream, edt)) |
| 2894 | | | return FALSE; |
| 2895 | | | if (!print_line(print_stream, 0, "")) |
| 2896 | | | return FALSE; |
| 2897 | | | } |
| 2898 | | | return TRUE; |
| 2899 | | | } |
| |