dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtmail / dtmail / RoamMenuWindow.C
index 446c89a576451e74347a54fab37382ade7e0ae93..75764df982bc628c8129a1ddcc464c865fcec701 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  * Floor, Boston, MA 02110-1301 USA
  */
 #include <unistd.h>
 #include <sys/param.h>
 
-#ifdef __uxp__
-#include <string.h>
-#endif
-
-#if !defined(USL) && !defined(__uxp__)
 #include <strings.h>
-#endif
 #include <errno.h>
 #include <unistd.h>
 #include <sys/utsname.h>
@@ -421,8 +415,7 @@ RoamMenuWindow::RoamMenuWindow (char *name) : MenuWindow ("dtmail", True)
     else
       _inbox = FALSE;
 
-    if (NULL != mail_file)
-      free((void*)mail_file);
+    free((void*)mail_file);
 
     _list      = NULL;
     _genDialog  = NULL;
@@ -465,8 +458,8 @@ RoamMenuWindow::RoamMenuWindow (char *name) : MenuWindow ("dtmail", True)
     else
       _last_sorted_by = (SortBy) atoi(value);
 
-    if (NULL != value) free((void*) value);
-    if (NULL != buffer) XtFree(buffer);
+    free((void*) value);
+    XtFree(buffer);
 
 }
 
@@ -788,7 +781,7 @@ RoamMenuWindow::createWorkArea(Widget parent)
 
     int header_lines = (int) strtol(value, NULL, 10);
     _list->visibleItems(header_lines);
-    if (NULL != value) free((void*) value);
+    free((void*) value);
 
     XtAddCallback(
        _list->get_scrolling_list(), XmNhelpCallback, 
@@ -1863,8 +1856,7 @@ RoamMenuWindow::propsChanged(void)
     if (header_lines != _list->visibleItems())
        _list->visibleItems(header_lines);
 
-    if (NULL != value)
-      free((void*) value);
+    free((void*) value);
 
     _list->checkDisplayProp();
     _my_editor->textEditor()->update_display_from_props();
@@ -2788,7 +2780,7 @@ RoamMenuWindow::create_container_callback(void *client_data, char *selection)
 {
     RoamMenuWindow *obj = (RoamMenuWindow*) client_data;
     obj->create_new_container(selection);
-    if (NULL != selection) XtFree(selection);
+    XtFree(selection);
 }
 
 void
@@ -4250,6 +4242,8 @@ RoamMenuWindow::syncViewAndStoreCallback(
     RoamMenuWindow * rmw = (RoamMenuWindow *)client_data;
 
     bval = rmw->syncViewAndStore(op, path, args);
+    
+    va_end(args);
     return(bval);
 }
 
@@ -5115,7 +5109,7 @@ RoamMenuWindow::inList(char *filename, DtVirtArray<ContainerMenuCmd *> *list)
     for (int i=0; i < list->length(); i++)
     {
        cmd = (*list)[i];
-       if (strcmp(filename, cmd->containerName()) == 0)
+       if (filename && strcmp(filename, cmd->containerName()) == 0)
          return(i);
     }
     return(-1);
@@ -5152,8 +5146,7 @@ RoamMenuWindow::addToCachedContainerList(char *filename)
                        &mail_file);
 
         is_inbox = (0 == strcmp(mail_file, filename));
-       if (NULL != mail_file)
-         free((void*) mail_file);
+       free((void*) mail_file);
        if (is_inbox)
          return;