nsgmls: resolve coverity warnings related to uninitialed members in C++ classes
[oweals/cde.git] / cde / programs / dtpad / main.c
index 8b598ae9333f3c7d6c9753943392e9001180be46..ef37464b6e81c7e821cd2c8085c639ce6b224d99 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 /* $TOG: main.c /main/27 1999/09/15 15:16:51 mgreess $ */
 /**********************************<+>*************************************
 ***************************************************************************
@@ -254,7 +276,7 @@ static int dtpadXIOErrorHandler(
  *                             edit window)
  *
  ************************************************************************/ 
-void 
+int 
 main(
         int argc,
         char **argv )
@@ -611,6 +633,11 @@ CreateFirstPad(
        initialServerResources = pPad->xrdb;
        initialServerResources.server = False; /* so window will be mapped */ 
        initialServerGeometry = pPad->geometry;
+       if(pPad->xrdb.workspaceList)
+               pPad->xrdb.workspaceList = strdup(pPad->xrdb.workspaceList);
+       if(pPad->xrdb.session)
+               pPad->xrdb.session = strdup(pPad->xrdb.session);
+       pPad->geometry = strdup(pPad->geometry);
     }
 
     /* Set some initial Editor instance values */
@@ -902,7 +929,7 @@ SendMessageToServer(
      ttdt_subcontract_manage(msg,
                        pStatusCB,
                        NULL,
-                       (void *) ((int) pPad->xrdb.blocking));/* client data */
+                       (void *) ((XtArgVal) pPad->xrdb.blocking));/* client data */
 
      /* Add pArgs to msg using tt_message_context_set */
      SetupLoadArgs(msg, pPad);
@@ -963,7 +990,7 @@ InitEditSessionAndFirstPad(
         sigfillset(&act.sa_mask);
         act.sa_flags = 0;
         act.sa_handler = SigcldHndlr;
-        sigaction(SIGCLD, &act, (struct sigaction *)NULL);
+        sigaction(SIGCHLD, &act, (struct sigaction *)NULL);
     }
 }
 
@@ -1141,7 +1168,7 @@ StartDbUpdate(
 void
 exitCB(Widget w, XtPointer callData, XtPointer clientData)
 {
-    exit((int) clientData);
+    exit((XtArgVal) clientData);
 }
 
 /************************************************************************
@@ -1569,7 +1596,7 @@ void SigcldHndlr (int dummy)
     /*
      * Is this really necessary?
      */
-    sigaction(SIGCLD, &act, (struct sigaction *)NULL);
+    sigaction(SIGCHLD, &act, (struct sigaction *)NULL);
 }
 
 
@@ -1655,7 +1682,6 @@ RestoreInitialServerResources(
        XtFree(pPad->geometry );
 
     pPad->xrdb = initialServerResources;
-    pPad->geometry = initialServerGeometry;
 
     /* -----> duplicate resource strings */
     if (initialServerResources.workspaceList != (char *)NULL)
@@ -1796,7 +1822,7 @@ Usage(
 
    template = (GETMESSAGE(7,10, message_string2));
 
-   fprintf (stderr, template);
+   fprintf (stderr, "%s", template);
 
    exit (0);
 }