dtcm: Resolve CID 87408
[oweals/cde.git] / cde / programs / dtcm / dtcm / dssw.c
index 5526e4bb7bd181f006248a75a53ee84a2706f6ee..8ab3c8df07f478df7f6cb2cf222289e264df3826 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
+ */
 /*******************************************************************************
 **
 **  dssw.c
@@ -94,8 +116,8 @@ dssw_set_start_hour(Widget w, XtPointer client_data, XtPointer cbs) {
        XtVaGetValues(w, XmNuserData, &user_data, NULL);
 
        if (user_data == NO_TIME) {
-               sprintf(dssw->start_val.val, "\0");
-               sprintf(dssw->stop_val.val, "\0");
+               dssw->start_val.val[0] = '\0';
+               dssw->stop_val.val[0]  = '\0';
                dssw->start_val.block = dssw->stop_val.block = TIME_AM;
         } else if (user_data == ALL_DAY) {
                if (dt == HOUR12) {
@@ -150,7 +172,7 @@ dssw_set_stop_hour(Widget w, XtPointer client_data, XtPointer cbs) {
        XtVaGetValues(w, XmNuserData, &user_data, NULL);
 
        if (user_data == NO_TIME) {
-               sprintf(dssw->stop_val.val, "\0");
+               dssw->stop_val.val[0] = '\0';
                dssw->stop_val.block = TIME_AM;
        } else {
                hrs = user_data / hrsec;
@@ -671,7 +693,7 @@ dssw_form_to_todo(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t)
         * Todo does not have end time.  So to distinguish between this
         * and the editor, zero this out.
         */
-       sprintf(dssw->stop_val.val, "\0");
+       dssw->stop_val.val[0] = '\0';
        if (blank_buf(dssw->date_val)) {
                editor_err_msg(dssw->parent, name, MISSING_DATE,
                               pu->xm_error_pixmap);
@@ -811,7 +833,7 @@ dssw_attrs_to_form(DSSW *dssw, Dtcm_appointment *appt) {
                                        minute(end_tick));
                } else {
                        /* no end time */
-                       sprintf(dssw->stop_val.val, "\0");
+                       dssw->stop_val.val[0] = '\0';
                        dssw->stop_val.block = TIME_AM;
                }
        }
@@ -820,7 +842,7 @@ dssw_attrs_to_form(DSSW *dssw, Dtcm_appointment *appt) {
 
        if (what) {
                strncpy(dssw->what_val, what, WHAT_LEN - 1);
-               dssw->what_val[WHAT_LEN-1] = NULL;
+               dssw->what_val[WHAT_LEN-1] = '\0';
        }
 
        set_dssw_vals(dssw, tick);