dtcm: Resolve CID 87562
[oweals/cde.git] / cde / programs / dtcm / dtcm / x_graphics.c
index 377facd17c5c75f7e0b67f17a737ae132e64fd38..bfee10c797d1d6942c8f96909e463430529759a9 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
+ */
 /* $XConsortium: x_graphics.c /main/15 1996/11/25 10:29:30 rswiston $ */
 /*
  * (c) Copyright 1996 Digital Equipment Corporation.
@@ -44,6 +66,9 @@
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 /*
@@ -1652,7 +1677,7 @@ cm_count_appts(CMGraphicsInfo *gInfo, CSA_entry_handle *list, int a_total,
     if (stat != CSA_SUCCESS)
     {
       free_appt_struct(&appt);
-      return;
+      return 0;
     }
     skip_appt = B_FALSE;
 
@@ -2203,6 +2228,8 @@ x_open_file(Calendar *c)
                            NULL, 0);
 #endif
 
+#if defined(PRINTING_SUPPORTED)
+
 #ifdef GR_DEBUG
   if (!inDebugMode(c))
   {
@@ -2237,6 +2264,8 @@ x_open_file(Calendar *c)
 #ifdef GR_DEBUG
   }
 #endif
+#endif  /* PRINTING_SUPPORTED */
+
 
   nargs = 0;
 #ifdef SHELL_SIZE_BUG
@@ -2858,7 +2887,7 @@ x_print_multi_appts(void *gInfoP,
     /* HH:MM xm - HH:MM xm format */
     format_line2(appt, buf1, buf2, dt);
 
-    indented = (*buf1 != NULL);
+    indented = (*buf1 != '\0');
     indentAmt = (view == dayGlance) ? 0 : 1;
     if (indented)
       indentAmt += 2;
@@ -2963,7 +2992,7 @@ x_print_list_range(Calendar *c, CSA_sint32 appt_type, int item_data,
                                     "Appt List Beginning: %s"), buf2);
 
        setup_range(&range_attrs, &ops, &i, start, end, appt_type,
-                   NULL, B_FALSE, c->general->version);
+                   0, B_FALSE, c->general->version);
        stat = csa_list_entries(c->cal_handle, i, range_attrs,
                                ops, &a_total, &list, NULL);
        if (stat != CSA_SUCCESS) {
@@ -3910,7 +3939,7 @@ x_print_month_appts(void *gInfoP, CSA_entry_handle *list,
     {
       get_time_str(appt, buf1);
 
-      indented = (*buf1 != NULL);
+      indented = (*buf1 != '\0');
 
       lines = text_to_lines(appt->what->value->item.string_value, 1);
       line_counter++;