Make the column check actually check the information column status.
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 13 Jan 2009 20:37:28 +0000 (20:37 +0000)
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 13 Jan 2009 20:37:28 +0000 (20:37 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27222 f5534014-38df-0310-8fa8-9805f1628bb7

tap-protocolinfo.c

index 4f9c4b934a0da526b9477934366f4785bcb2387a..45ec4dcf7acaa0ef036813fae3cd25d3a57448cd 100644 (file)
@@ -64,11 +64,11 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo
         * is to modify the columns, and if the columns aren't being
         * displayed, that makes this tap somewhat pointless.
         *
         * is to modify the columns, and if the columns aren't being
         * displayed, that makes this tap somewhat pointless.
         *
-        * To prevent a crash, we check whether pinfo->cinfo is null
-        * and, if so, we report that error and exit.
+        * To prevent a crash, we check whether INFO column is writable
+        * and, if not, we report that error and exit.
         */
         */
-       if (pinfo->cinfo == NULL) {
-               fprintf(stderr, "tshark: the proto,colinfo tap doesn't work if the columns aren't being printed.\n");
+       if (!check_col(pinfo->cinfo, COL_INFO)) {
+               fprintf(stderr, "tshark: the proto,colinfo tap doesn't work if the INFO column isn't being printed.\n");
                exit(1);
        }
        gp=proto_get_finfo_ptr_array(edt->tree, rs->hf_index);
                exit(1);
        }
        gp=proto_get_finfo_ptr_array(edt->tree, rs->hf_index);