Sync with HEAD.
[kai/samba.git] / examples / libsmbclient / tree.c
index da60236e601e7a932126fe0c144351679627fa24..8dc9cc408b38fe120dcf2ac1a4cb602b90ba59f2 100644 (file)
@@ -51,7 +51,8 @@ void error_message(gchar *message) {
   /* Ensure that the dialog box is destroyed when the user clicks ok. */
      
   gtk_signal_connect_object (GTK_OBJECT (okay_button), "clicked",
-                            GTK_SIGNAL_FUNC (gtk_widget_destroy), dialog);
+                            GTK_SIGNAL_FUNC (gtk_widget_destroy), 
+                            GTK_OBJECT(dialog));
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area),
                     okay_button);
 
@@ -744,8 +745,6 @@ int main( int   argc,
 
   /* Now, get the items in smb:/// and add them to the tree */
 
-  dirp = (struct smbc_dirent *)dirbuf;
-
   while ((err = smbc_getdents(dh, (struct smbc_dirent *)dirbuf, 
                              sizeof(dirbuf))) != 0) {
 
@@ -758,6 +757,8 @@ int main( int   argc,
 
     }
 
+    dirp = (struct smbc_dirent *)dirbuf;
+
     fprintf(stdout, "Dir len: %u\n", err);
 
     while (err > 0) { /* Extract each entry and make a sub-tree */