dtlogin: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtlogin / vgcallback.c
index cc2fdff750192a3733f714c9e34d90e3ca6a0eb5..69461c18a602534031b2fd8618f5a4c9b48a3b3a 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
  */
@@ -448,7 +448,7 @@ EditPasswdCB(Widget w, XtPointer client, XtPointer call_data)
 
     if (cbs->text->ptr)
     {
-        strcpy(s, cbs->text->ptr);
+        snprintf(s, sizeof(buffer) - (s - buffer), "%s", cbs->text->ptr);
        s += cbs->text->length;
     }
     else
@@ -794,7 +794,7 @@ MenuItemCB( Widget w, XtPointer client_data, XtPointer call_data )
 
     session_selected = True;
 
-    switch ( (int) client_data) {
+    switch ( (long) client_data) {
 
     case OB_RESTART_SERVER:
        CleanupAndExit(NULL, NOTIFY_RESTART);
@@ -1242,6 +1242,8 @@ RequestCB(
                                       XmFONTLIST_DEFAULT_TAG));
               string = XmStringConcat(xmstr, XmStringSeparatorCreate());
             }
+
+            fclose(fp);
           }
           else
           {
@@ -1499,8 +1501,7 @@ RespondLangCB( Widget w, XtPointer client, XtPointer call)
        /** beginning of main.                            **/
        char buff[128];
        if (XmToggleButtonGadgetGetState(w)) {
-           strcpy(buff, "LANG="); 
-           strcat(buff, client);
+           snprintf(buff, sizeof(buff), "LANG=%s", (char *) client);
            putenv(buff);
            execv(orig_argv[0], orig_argv);
        }
@@ -1675,7 +1676,7 @@ SetDefaultDt(Widget w)
  *  the logo to display in logo_pixmap 
  **************************************************************************/
 void
-SetDtLabelAndIcon()
+SetDtLabelAndIcon(void)
 {
   static XmString      blanks = NULL;
   int                  i;
@@ -1941,5 +1942,7 @@ TellRequester(char * buf, size_t nbytes)
 #ifdef VG_TRACE
   vg_TRACE_EXECUTION("main:  entered TellRequester ...");
 #endif /* VG_TRACE */
-  write(1, buf, nbytes);
+  if(-1 == write(1, buf, nbytes)) {
+    perror(strerror(errno));
+  }
 }