dtcm: Resolve CID 87562
[oweals/cde.git] / cde / programs / dtcm / dtcm / dayglance.c
index 5d3d88ef50cc94170fddeed13d2515dac8c76afd..0bc9ccf694a421fbb8ab3fde2f7c5315a149d24e 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
+ */
 /*******************************************************************************
 **
 **  dayglance.c
@@ -59,6 +81,9 @@ static char sccsid[] = "@(#)dayglance.c 1.76 95/04/24 Copyr 1991 Sun Microsystem
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 extern int debug;
@@ -186,7 +211,7 @@ paint_dayview_appts(Calendar *c, Paint_cache *cache, int a_total, void *rect)
        for (i = begin_time - 1; i < end_time; i++) {
                hr = i;
                if (i < begin_time)
-                       (void) sprintf(buf, "");
+                       buf[0] = '\0';
                else if (disp_t == HOUR12) {
                        am = adjust_hour(&hr);
                        (void) sprintf(buf, "%d%s", hr, am ? "a" : "p");
@@ -242,7 +267,7 @@ paint_dayview_appts(Calendar *c, Paint_cache *cache, int a_total, void *rect)
                                                appt_str, end_tick, 
                                                cache[i].show_time, disp_t);
                                }
-                               appt_str[cm_strlen(appt_str)]=NULL;
+                               appt_str[cm_strlen(appt_str)] = '\0';
 
 /* REVISIT: unclear why we're still distinguishing between gr_text[_rgb]
                                if (c->xcontext->screen_depth >= 8) 
@@ -312,7 +337,7 @@ paint_dayview_appts(Calendar *c, Paint_cache *cache, int a_total, void *rect)
                                                appt_str, end_tick, 
                                                cache[i].show_time, disp_t);
                                }
-                               appt_str[cm_strlen(appt_str)]=NULL;
+                               appt_str[cm_strlen(appt_str)] = '\0';
 
 /* REVISIT: unclear why we're still distinguishing between gr_text[_rgb]
                                if (c->xcontext->screen_depth >= 8) 
@@ -595,7 +620,7 @@ paint_dayview(Calendar *c, Boolean repaint, XRectangle *rect, Boolean update_mon
        if (c->paint_cache == NULL) {
                start = (time_t) lower_bound(0, c->view->date);
                stop = (time_t) next_nhours(start, end+1) - 1;
-               setup_range(&range_attrs, &ops, &j, start, stop, CSA_TYPE_EVENT, NULL,
+               setup_range(&range_attrs, &ops, &j, start, stop, CSA_TYPE_EVENT, 0,
                        B_FALSE, c->general->version);
                csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL);
        
@@ -786,7 +811,7 @@ count_day_pages(Calendar *c, int lines_per_page, Tick tick)
                start = (time_t) lower_bound(i, tick);
                end = (time_t) next_nhours(start+1, 1) - 1;
                setup_range(&range_attrs, &ops, &j, start, end,
-                           CSA_TYPE_EVENT, NULL, B_FALSE, c->general->version);
+                           CSA_TYPE_EVENT, 0, B_FALSE, c->general->version);
                csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL);
                free_range(&range_attrs, &ops, j);
 
@@ -863,7 +888,7 @@ _print_day(Calendar *c,
       start = (time_t) lower_bound(i, tick);
       stop = (time_t) next_nhours(start+1, 1) - 1;
       setup_range(&range_attrs, &ops, &j, start, stop,
-                 CSA_TYPE_EVENT, NULL, B_FALSE, c->general->version);
+                 CSA_TYPE_EVENT, 0, B_FALSE, c->general->version);
 
       csa_list_entries(c->cal_handle, j, range_attrs,
                       ops, &a_total, &list, NULL);