diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-06-12 11:54:21 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-06-12 18:55:17 +0000 |
commit | a972e8f2b3615c07b9dad28611c00c158a9b103c (patch) | |
tree | 86275ed4ee12827fcee0e27d9183aa829be55090 /ui | |
parent | c246513dbae1d600aec9fc8f23c9a28f1937117a (diff) |
Try to fix a used-but-not-set warning.
I'm guessing that GCC is complaining because "device" isn't guaranteed
to be set (if there are no interfaces, the body of the loop will never
be executed), so do with the list of link-layer header types what's done
for the buffer size and snapshot length.
But should the column-setting code be executed if the interface isn't
found?
Change-Id: I8c365a482b8af44cdd1c1a7f41ca611141387c86
Reviewed-on: https://code.wireshark.org/review/2180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/capture_interfaces_dialog.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp index 173faf1269..14df410b3b 100644 --- a/ui/qt/capture_interfaces_dialog.cpp +++ b/ui/qt/capture_interfaces_dialog.cpp @@ -600,6 +600,7 @@ QWidget* TbInterfacesDelegate::createEditor( QWidget *parent, const QStyleOption gint buffer = DEFAULT_CAPTURE_BUFFER_SIZE; #endif guint snap = WTAP_MAX_PACKET_SIZE; + GList *links = NULL; if (index.column() > 1) { interface_t device; @@ -611,6 +612,7 @@ QWidget* TbInterfacesDelegate::createEditor( QWidget *parent, const QStyleOption buffer = device.buffer; #endif snap = device.snaplen; + links = device.links; if (interface_name.compare(device.display_name) || device.hidden || device.type == IF_PIPE) { continue; } else { @@ -625,7 +627,7 @@ QWidget* TbInterfacesDelegate::createEditor( QWidget *parent, const QStyleOption GList *list; link_row *temp; QComboBox *cb = new QComboBox(parent); - for (list=device.links; list!=NULL; list=g_list_next(list)) { + for (list=links; list!=NULL; list=g_list_next(list)) { temp = (link_row*)(list->data); cb->addItem(QString("%1").arg(temp->name)); } |