(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/drag_and_drop.c) |
| |
| 308 | | | dnd_data_received(GtkWidget *widget _U_, GdkDragContext *dc _U_, gint x _U_, gint y _U_, |
| 309 | | | GtkSelectionData *selection_data, guint info, guint t _U_, gpointer data _U_) |
| 310 | | | { |
| 311 | | | gpointer dialog; |
| 312 | | | gchar *cf_names_freeme; |
| 313 | | | |
| 314 | | | if (info == DND_TARGET_URL) { |
| 315 | | | |
| 316 | | | |
| 317 | | | |
| 318 | | | |
| 319 | | | |
| 320 | | | #ifdef HAVE_LIBPCAP |
| 321 | | | |
| 322 | | | if((global_capture_opts.state != CAPTURE_STOPPED)) { |
| 323 | | | dialog = simple_dialog(ESD_TYPE_CONFIRMATION, |
Unused Value
The value assigned to dialog is never subsequently used on any execution path. |
|
| 324 | | | ESD_BTN_OK, |
| 325 | | | "%sDrag and Drop currently not possible!%s\n\n" |
| 326 | | | "Dropping a file isn't possible while a capture is in progress.", |
| 327 | | | simple_dialog_primary_start(), simple_dialog_primary_end()); |
| 328 | | | return; |
| 329 | | | } |
| 330 | | | #endif |
| 331 | | | |
| 332 | | | |
| 333 | | | if((cfile.state == FILE_READ_IN_PROGRESS)) { |
| 334 | | | dialog = simple_dialog(ESD_TYPE_CONFIRMATION, |
| 335 | | | ESD_BTN_OK, |
| 336 | | | "%sDrag and Drop currently not possible!%s\n\n" |
| 337 | | | "Dropping a file isn't possible while loading another capture file.", |
| 338 | | | simple_dialog_primary_start(), simple_dialog_primary_end()); |
| 339 | | | return; |
| 340 | | | } |
| 341 | | | |
| 342 | | | |
| 343 | | | |
| 344 | | | cf_names_freeme = g_malloc(selection_data->length + 1); |
| 345 | | | memcpy(cf_names_freeme, selection_data->data, selection_data->length); |
| 346 | | | cf_names_freeme[selection_data->length] = '\0'; |
| 347 | | | |
| 348 | | | |
| 349 | | | if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) { |
| 350 | | | |
| 351 | | | dialog = simple_dialog(ESD_TYPE_CONFIRMATION, |
| 352 | | | ESD_BTNS_SAVE_DONTSAVE_CANCEL,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/simple_dialog.h |
| |
76 | #define ESD_BTNS_SAVE_DONTSAVE_CANCEL (ESD_BTN_DONT_SAVE|ESD_BTN_CANCEL|ESD_BTN_SAVE) |
| |
|
| 353 | | | "%sSave capture file before opening a new one?%s\n\n" |
| 354 | | | "If you open a new capture file without saving, your current capture data will be discarded.", |
| 355 | | | simple_dialog_primary_start(), simple_dialog_primary_end()); |
| 356 | | | simple_dialog_set_cb(dialog, dnd_save_file_answered_cb, cf_names_freeme ); |
| 357 | | | } else { |
| 358 | | | |
| 359 | | | dnd_open_file_cmd( cf_names_freeme ); |
| 360 | | | } |
| 361 | | | } |
| 362 | | | } |
| |