printf okay strcpy with cName_pt segment fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




void
on_filechooserwidget2_selection_changed(GtkFileChooser *fs) {
        printf("\n Selection changed. \n");
        char    *cName_pt;
        cName_pt = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(fs));
printf("\n cName_pt = %s .\n", cName_pt); //Prints selected file okay.
//      strcpy(fileselected, cName_pt);    //This gives segment fault?
strcpy(fileselected, test_pt); //This works okay, test=1234 passed to high level.
        return;
Hi All,
I do not understand why I'm getting a segment fault from strcpy using cName_pt in the above code. I can printf using cName_pt and it prints the file that I selected using the glade gtkfilechooserwidget. I must be doing something silly, I hope that someone can see what it is? Regards Ian.
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux