+/*
+ * 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
+ */
/*******************************************************************************
**
** format.c
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
#include <X11/Xos_r.h>
/*
struct tm *tm;
_Xltimeparams localtime_buf;
- buf[0]=NULL;
+ buf[0] = '\0';
tm = _XLocaltime(&t, localtime_buf);
m = tm->tm_mon+1;
d = tm->tm_mday;
char *str = (char *) separator_str(sep);
_Xltimeparams localtime_buf;
- buf[0]=NULL;
+ buf[0] = '\0';
tm = _XLocaltime(&t, localtime_buf);
m = tm->tm_mon+1;
_Xltimeparams localtime_buf;
if (buf==NULL) return pad;
- buf[0]=NULL;
+ buf[0] = '\0';
tm = _XLocaltime(&tick, localtime_buf);
hr = tm->tm_hour;
mn = tm->tm_min;
width, so I have to line it up myself.. */
if (display == HOUR12) {
if (hr > 9)
- (char *)sprintf(buf, "%2d:%.2d%s ",
+ sprintf(buf, "%2d:%.2d%s ",
hr, mn, am ? "a" : "p");
else {
- (char *)sprintf(buf, "%d:%.2d%s ",
+ sprintf(buf, "%d:%.2d%s ",
hr, mn, am ? "a" : "p");
pad = TRUE;
}
}
else
- (char *)sprintf(buf, "%02d%02d ", hr, mn);
+ sprintf(buf, "%02d%02d ", hr, mn);
}
}
if (what)
if (appt->end_time)
_csa_iso8601_to_tick(appt->end_time->value->item.string_value,
&end_tick);
- *buf1 = NULL;
+ *buf1 = '\0';
if (appt == NULL || appt->what->value->item.string_value == NULL) return;
tm = _XLocaltime(&tick, localtime_buf);
hour1 = tm->tm_hour;
* Extract an appointment and format it into 2 lines of no more
* then maxchars
*/
- *buf1 = *buf2 = NULL;
+ *buf1 = *buf2 = '\0';
if (appt == NULL || appt->what->value->item.string_value == NULL) return;
tm = _XLocaltime(&tick, localtime_buf);
hour1 = tm->tm_hour;
if (lines == NULL || lines->s == NULL ||
(cm_strlen(lines->s) == 1 && lines->s[0] == ' '))
- buf2[0] = NULL;
+ buf2[0] = '\0';
else
sprintf(buf2, " %s", lines->s);
destroy_lines(lines);