Redo the block options APIs.
[metze/wireshark/wip.git] / ui / qt / resolved_addresses_dialog.cpp
index 791f6d1ca7111cbb977faf0b8645b32966927478..2e8b45cd0b8207ba4bf9cf46cb88d0604023c5f5 100644 (file)
@@ -197,7 +197,22 @@ ResolvedAddressesDialog::ResolvedAddressesDialog(QWidget *parent, CaptureFile *c
         wtap* wth = capture_file->capFile()->wth;
         if (wth) {
             // might return null
-            comment_ = wtap_get_nrb_comment(wth);
+            wtap_block_t nrb_hdr;
+
+            /*
+             * XXX - support multiple NRBs.
+             */
+            nrb_hdr = wtap_file_get_nrb(wth);
+            if (nrb_hdr != NULL) {
+                char *str;
+
+                /*
+                 * XXX - support multiple comments.
+                 */
+                if (wtap_block_get_nth_string_option_value(nrb_hdr, OPT_COMMENT, 0, &str) == WTAP_OPTTYPE_SUCCESS) {
+                    comment_ = str;
+                }
+            }
         }
     }