dtcm: Resolve CID 87408
[oweals/cde.git] / cde / programs / dtcm / dtcm / cm_insert.c
index 5d932a57f01200d6c93dceb3c333b68c22e498f4..5edb3e5f9991013b4b1a53c1cc6b99f4966a729a 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
+ */
 /*******************************************************************************
 **
 **  cm_insert.c
@@ -123,8 +145,8 @@ cm_args(int argc, char **argv)
                        argv = grab(++argv,cm_appt_file,'-');
                        break;
                default:
-                       fprintf(stderr, catgets(DT_catd, 1, 191, "Usage:\n\tdtcm_insert [ -c calendar ] [-d <mm/dd/yy>] [ -v view ]\n"));
-                       fprintf(stderr, catgets(DT_catd, 1, 192, "                   [-w what string] [-s <HH:MMam/pm>] [-e <HH:MMam/pm>]\n"));
+                       fprintf(stderr, "%s", catgets(DT_catd, 1, 191, "Usage:\n\tdtcm_insert [ -c calendar ] [-d <mm/dd/yy>] [ -v view ]\n"));
+                       fprintf(stderr, "%s", catgets(DT_catd, 1, 192, "                   [-w what string] [-s <HH:MMam/pm>] [-e <HH:MMam/pm>]\n"));
                        exit(1);
                }
        }
@@ -157,7 +179,7 @@ prompt_for_insert(Props *p) {
         format_tick(now(), get_int_prop(p, CP_DATEORDERING),
                    get_int_prop(p, CP_DATESEPARATOR), date_str);
 
-       printf(catgets(DT_catd, 1, 193, "Please enter the information for the appointment you wish to add.\nDefaults will be shown in parentheses.\n"));
+       printf("%s", catgets(DT_catd, 1, 193, "Please enter the information for the appointment you wish to add.\nDefaults will be shown in parentheses.\n"));
        prompt_for_line(catgets(DT_catd, 1, 194, 
                "Calendar (%s): "), cm_get_credentials(), cm_target);
        prompt_for_line(catgets(DT_catd, 1, 195, 
@@ -173,7 +195,7 @@ prompt_for_insert(Props *p) {
                        if (valid_time(p, timecopy))
                                valid = TRUE;
                        else
-                               printf(catgets(DT_catd, 1, 197, "You have entered an invalid time.  Please try again:\n"));
+                               printf("%s", catgets(DT_catd, 1, 197, "You have entered an invalid time.  Please try again:\n"));
                        free(timecopy);
                }
        }
@@ -196,14 +218,14 @@ prompt_for_insert(Props *p) {
                        "Repeat (%s): "), cm_repeatstr, cm_repeatstr);
 
        if (strcmp(cm_repeatstr, catgets(DT_catd, 1, 200, "One Time"))) {
-               sprintf(buf, catgets(DT_catd, 1, 203, "no default"));
+               sprintf(buf, "%s", catgets(DT_catd, 1, 203, "no default"));
                prompt_for_line(
                        catgets(DT_catd, 1, 204, "For (%s): "), buf, cm_for);
        }
 
-       printf(catgets(DT_catd, 1, 205, 
+       printf("%s", catgets(DT_catd, 1, 205, 
                "What (you may enter up to 5 lines, use ^D to finish):\n"));
-       cm_what[0] = NULL;
+       cm_what[0] = '\0';
        for (index = 0; index < 5; index++)
        {
                *what_buffer = '\0';