if (new_w->month_panel.active_days) {
btn = XmCreatePushButtonGadget((Widget)new_w, buf, wargs, 1);
XtAddCallback(btn, XmNactivateCallback, DayCallback,
- (XtPointer)(i+1));
+ (XtPointer) (intptr_t) (i+1));
}
else {
btn = XmCreateLabelGadget((Widget) new_w, buf, wargs, 1);
XmMonthPanelCallbackStruct data;
data.type = DAY_SELECTION;
- data.day = (int) client;
+ data.day = (intptr_t) client;
XtCallCallbackList((Widget) mp, mp->month_panel.callback, &data);
}
bd = (BlistData *)ckalloc(sizeof(BlistData));
bd->name = cm_strdup(name);
bd->tag = t;
- bd->cal_handle = NULL;
+ bd->cal_handle = 0;
CmDataListAdd(bl->blist_data, (void *)bd, location);
return location;
((*(end_ptr - 1) == ' ') || (*(end_ptr - 1) == '\t')))
end_ptr--;
- *end_ptr = NULL;
+ *end_ptr = '\0';
if (blank_buf(new_name)) {
blist_name_append(c, get_char_prop(p, CP_DEFAULTCAL), BLIST_ACTIVE);
namelist = cm_strdup(get_char_prop(p, CP_DAYCALLIST));
- if (namelist == NULL || *namelist == NULL )
+ if (namelist == NULL || *namelist == '\0' )
return;
name = strtok(namelist, " ");
cnt = bl->blist_data->count;
for (i = 1; i <= cnt; i++) {
bd = (BlistData *)CmDataListGetData(bl->blist_data, left_cnt);
- if (bd && bd->cal_handle == NULL &&
+ if (bd && bd->cal_handle == 0 &&
(clean_all || bd->tag != BLIST_ACTIVE)) {
if (bd->name)
free(bd->name);
* remember - this returns a RowColumn widget!
*/
b->gotomenu = XmVaCreateSimpleOptionMenu(b->upper_form,
- "goToOptionMenu", goto_label, NULL, 0, gotomenu_cb,
+ "goToOptionMenu", goto_label, 0, 0, gotomenu_cb,
XmVaPUSHBUTTON, prev_week, NULL, NULL, NULL,
XmVaPUSHBUTTON, this_week, NULL, NULL, NULL,
XmVaPUSHBUTTON, next_week, NULL, NULL, NULL,
if (bd->cache == NULL) {
setup_range(&range_attrs, &ops, &r_cnt, start, stop,
- CSA_TYPE_EVENT, NULL, B_FALSE, bd->version);
+ CSA_TYPE_EVENT, 0, B_FALSE, bd->version);
stat = csa_list_entries(bd->cal_handle, r_cnt, range_attrs, ops, &num_entries, &entries, NULL);
free_range(&range_attrs, &ops, r_cnt);
backend_err_msg(b->frame, bd->name, stat,
}
address = calloc(address_len+1, 1);
- address[0] = NULL;
+ address[0] = '\0';
for (i = 0; i < pos_cnt; i++) {
bd = (BlistData *)CmDataListGetData(bl->blist_data,
static void
gotomenu_cb(Widget w, XtPointer data, XtPointer cbs)
{
- int item_no = (int) data;
+ int item_no = (int) (intptr_t) data;
/* should really be getting this from the widget */
Calendar *c = calendar;
if (bd->cache == NULL) {
setup_range(&range_attrs, &ops, &r_cnt, start,
stop, CSA_TYPE_EVENT,
- NULL, B_FALSE, bd->version);
+ 0, B_FALSE, bd->version);
stat = csa_list_entries(bd->cal_handle, r_cnt, range_attrs,
ops, &num_entries, &entries, NULL);
free_range(&range_attrs, &ops, r_cnt);
backend_err_msg(b->frame, bd->name, stat,
p->xm_error_pixmap);
}
- bd->cal_handle = NULL;
+ bd->cal_handle = '\0';
blist_clean(bl, False);
}
}
*/
void view_day_cb(Widget w, XtPointer data, XtPointer cbs)
{
- if ((int) data == 0)
+ if ((intptr_t) data == 0)
day_button(w, data, cbs);
}
void view_week_cb(Widget w, XtPointer data, XtPointer cbs)
{
- if ((int) data == 0)
+ if ((intptr_t) data == 0)
week_button(w, data, cbs);
}
void view_month_cb(Widget w, XtPointer data, XtPointer cbs)
{
- if ((int) data == 0)
+ if ((intptr_t) data == 0)
month_button(w, data, cbs);
}
void view_year_cb( Widget w, XtPointer data, XtPointer cbs)
{
- if ((int) data == 0)
+ if ((intptr_t) data == 0)
(void) year_button(w, data, cbs);
}
Calendar *c = calendar;
_DtTurnOnHourGlass(c->frame);
- if ((int) item_no == 1)
+ if ((intptr_t) item_no == 1)
show_props_pu(c);
- else if ((int) item_no == 3)
+ else if ((intptr_t) item_no == 3)
make_find(c);
_DtTurnOffHourGlass(c->frame);
}
Calendar *c = calendar;
_DtTurnOnHourGlass(c->frame);
- switch((int) item_no) {
+ switch((intptr_t) item_no) {
case 0:
show_editor(c, 0, 0, False);
break;
static void
browse_cb(Widget w, XtPointer client_data, XtPointer cbs) {
- int rcode, idx = (int)client_data;
+ int rcode, idx = (int) (intptr_t) client_data;
char buf[MAXNAMELEN];
Calendar *c = calendar;
Props_pu *p = (Props_pu *)c->properties_pu;
str = (!strcmp(bd->name, c->calname)) ? "calName" : "myName";
item = XmCreatePushButtonGadget(c->browse_menu, str, al, ac);
XtAddCallback(item, XmNactivateCallback, browse_cb,
- (XtPointer)i);
+ (XtPointer) (intptr_t) i);
XmStringFree(xmstr);
}
NULL, NULL);
/* create the calendar */
- if ((status = csa_add_calendar(NULL, &csa_user, 1, &attr, NULL))
+ if ((status = csa_add_calendar(0, &csa_user, 1, &attr, NULL))
== CSA_E_UNSUPPORTED_ATTRIBUTE) {
/* server with version 4 or less does not support
* the CSA_CAL_ATTR_CHARACTER_SET cal attribute
*/
- status = csa_add_calendar(NULL, &csa_user, 0, NULL,
+ status = csa_add_calendar(0, &csa_user, 0, NULL,
NULL);
}
if (val.item.string_value) free(val.item.string_value);
{
Calendar *c = (Calendar *)data;
/* retry once */
- if (c->my_cal_handle == NULL && (open_user_calendar(c, False) == True))
+ if (c->my_cal_handle == 0 && (open_user_calendar(c, False) == True))
{
_DtTurnOnHourGlass(c->frame);
reset_timer(c);
uname = cm_get_uname();
if ((loc = get_char_prop((Props *)calendar->properties, CP_CALLOC)) &&
- *loc != NULL) {
+ *loc != '\0') {
loc = strdup(loc);
needfree = True;
} else
while (*s_ptr)
*d_ptr++ = *s_ptr++;
- *d_ptr++ = NULL;
+ *d_ptr++ = '\0';
}
d_ptr = NULL;
argv = grab(++argv,cm_view,'-');
break;
default:
- fprintf(stderr,catgets(DT_catd, 1, 187, "Usage:\n\tdtcm_delete [-c calendar] [-d <mm/dd/yy>] [-v view]\n"));
+ fprintf(stderr, "%s", catgets(DT_catd, 1, 187, "Usage:\n\tdtcm_delete [-c calendar] [-d <mm/dd/yy>] [-v view]\n"));
exit(1);
}
}
free(loc);
exit(0);
}
- fprintf(stdout, catgets(DT_catd, 1, 190,
+ fprintf(stdout, "%s", catgets(DT_catd, 1, 190,
"Item to delete (number)? "));
fgets(index, 9, stdin);
fprintf(stdout,"\n\n");
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';
argv = grab(++argv,cm_view,'-');
break;
default:
- fprintf(stderr,catgets(DT_catd, 1, 207, "Usage:\n\tdtcm_lookup [ -c calendar ][ -d <mm/dd/yy> ] [ -v view ]\n"));
+ fprintf(stderr, "%s", catgets(DT_catd, 1, 207, "Usage:\n\tdtcm_lookup [ -c calendar ][ -d <mm/dd/yy> ] [ -v view ]\n"));
exit(1);
}
}
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");
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)
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)
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);
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);
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);
drag_load_proc(dnd_filename, c);
unlink(dnd_filename);
- dnd_filename[0] = NULL;
+ dnd_filename[0] = '\0';
break;
default:
return;
if (validate_dropped_appt(dnd_filename, c) == False) {
unlink(dnd_filename);
- dnd_filename[0] = NULL;
+ dnd_filename[0] = '\0';
transfer_info->status = DtDND_FAILURE;
}
#ifdef NOT
XtFree(ident);
XtFree(text);
XtFree(title);
- return(NULL);
+ return(0);
}
XtFree(ident);
XtFree(title);
XtFree((XtPointer)item_list);
- return(NULL);
+ return(0);
}
return entry;
Editor *e = (Editor *) calendar->editor;
GEditor *ge = (GEditor *) calendar->geditor;
- if (e->drag_bitmap == NULL) {
+ if (e->drag_bitmap == 0) {
e->drag_bitmap = XCreateBitmapFromData(display,
window, (char *) drag_xbm_bits,
drag_xbm_width, drag_xbm_height);
- if (e->drag_bitmap == NULL) {
+ if (e->drag_bitmap == 0) {
printf("%s", catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n"));
return;
else
ge->drag_bitmap = e->drag_bitmap;
}
- if (e->drag_mask == NULL) {
+ if (e->drag_mask == 0) {
e->drag_mask = XCreateBitmapFromData(display,
window, (char *) drag_mask_xbm_bits,
drag_mask_xbm_width, drag_mask_xbm_height);
- if (e->drag_mask == NULL) {
+ if (e->drag_mask == 0) {
printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
return;
}
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) {
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;
* 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);
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;
}
}
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);
Window window = XtWindow(calendar->frame);
unsigned char *bitmapData, *bitmapMask;
- if (de->drag_bitmap == NULL) {
+ if (de->drag_bitmap == 0) {
de->drag_bitmap = XCreateBitmapFromData(display,
window, (char *) drag_xbm_bits,
drag_xbm_width, drag_xbm_height);
- if (de->drag_bitmap == NULL) {
+ if (de->drag_bitmap == 0) {
- printf(catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n"));
+ printf("%s", catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n"));
return;
}
}
- if (de->drag_mask == NULL) {
+ if (de->drag_mask == 0) {
de->drag_mask = XCreateBitmapFromData(display,
window, (char *) drag_mask_xbm_bits,
drag_mask_xbm_width, drag_mask_xbm_height);
- if (de->drag_mask == NULL) {
- printf(catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
+ if (de->drag_mask == 0) {
+ printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
return;
}
}
NULL)
== NULL) {
- printf(catgets(c->DT_catd, 1, 239, "DragStart returned NULL.\n"));
+ printf("%s", catgets(c->DT_catd, 1, 239, "DragStart returned NULL.\n"));
}
}
}
setup_range(&range_attr, &ops, &range_count, start, stop,
- CSA_TYPE_EVENT, NULL, B_FALSE, e->cal->general->version);
+ CSA_TYPE_EVENT, 0, B_FALSE, e->cal->general->version);
status = csa_list_entries(e->cal->cal_handle, range_count, range_attr, ops, count, entry_list, NULL);
backend_err_msg(e->frame, e->cal->view->current_calendar, status,
if (ptr = strchr(rule, 'Z')) {
while (*ptr != ' ')
ptr--;
- *ptr = NULL;
+ *ptr = '\0';
}
strcpy(newrule, rule);
astr = XmTextGetString(f->apptstr);
- if (astr == NULL || *astr == NULL) {
+ if (astr == NULL || *astr == '\0') {
sprintf(message, "%s", catgets(c->DT_catd, 1, 290, "Specify Appt String to Match."));
set_message(f->find_message, message);
return;
_DtTurnOnHourGlass(f->frame);
for (; stop <= end_of_time;) {
setup_range(&range_attrs, &ops, &range_count, start, stop,
- CSA_TYPE_EVENT, NULL, B_FALSE, c->general->version);
+ CSA_TYPE_EVENT, 0, B_FALSE, c->general->version);
stat = csa_list_entries(c->cal_handle, range_count, range_attrs, ops, &num_entries, &entries, NULL);
if (stat != CSA_SUCCESS) {
return;
}
- for (j = 0; appt->what->value->item.string_value[j] != NULL; j++)
+ for (j = 0; appt->what->value->item.string_value[j] != '\0'; j++)
if (strncasecmp(astr, &(appt->what->value->item.string_value[j]),
comparison_length) == 0) {
new_tick = (Tick_list *) ckalloc(sizeof(Tick_list));
* version available.
*/
if (!strcmp(cal->app_data->app_font_family, "application")) {
- sprintf (font_name, "-dt-%s-%s-r-normal-sans-%d-*-*-*-p-*",
+ sprintf (font_name, "-dt-%s-%s-r-normal-sans-%lu-*-*-*-p-*",
cal->app_data->app_font_family,
(weight == BOLD)?"bold":"medium",
pixel_size);
} else {
- sprintf (font_name, "-dt-%s-%s-r-normal--%d-*-*-*-*-*",
+ sprintf (font_name, "-dt-%s-%s-r-normal--%lu-*-*-*-*-*",
cal->app_data->app_font_family,
(weight == BOLD)?"bold":"medium",
pixel_size);
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);
g = (Goto*)c->goTo;
date = XmTextGetString(g->datetext);
- if ((*date == NULL) || (date == NULL)) {
+ if ((date == NULL) || (*date == '\0')) {
sprintf(message, "%s", catgets(c->DT_catd, 1, 297, "Please type in a date"));
set_message(g->goto_message, message);
return;
if ((*stipple = XCreateBitmapFromData(xc->display,
xc->xid,
/* RootWindow(xc->display, DefaultScreen(xc->display)), */
- (char *)data, datawidth, dataheight)) == NULL) {
+ (char *)data, datawidth, dataheight)) == 0) {
ok = False;
}
else {
}
address = calloc(address_len+1, 1);
- memset(address, NULL, address_len);
+ memset(address, 0, address_len);
for (i = 0; i < pos_cnt; i++) {
ad = (Access_data *)CmDataListGetData(ge->access_data,
continue;
setup_range(&range_attr, &ops, &range_count, start, stop,
- CSA_TYPE_EVENT, NULL, B_FALSE, step->version);
+ CSA_TYPE_EVENT, 0, B_FALSE, step->version);
csa_list_entries(step->cal_handle, range_count, range_attr,
ops, &entry_count, &entry_list, NULL);
free_range(&range_attr, &ops, range_count);
ac = 0;
XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
- switch ((int)clientData) {
+ switch ((intptr_t)clientData) {
case HELP_OVERVIEW:
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
while (!XtIsSubclass(w, applicationShellWidgetClass))
w = XtParent(w);
- status = DtHelpReturnSelectedWidgetId(w, NULL, &selWidget);
+ status = DtHelpReturnSelectedWidgetId(w, 0, &selWidget);
switch ((int)status)
{
case DtHELP_SELECT_ERROR:
/* See if the resolution size we have chosen is acceptable by the WM */
if (!(size = wm_icon_preference(XtDisplay(c->frame), screen, size))) {
- c->icon->icon = NULL;
- c->icon_inverted->icon = NULL;
+ c->icon->icon = 0;
+ c->icon_inverted->icon = 0;
return (FALSE);
}
if (!(icon_filename = XmGetIconFileName(screen, NULL, icon_name,
NULL, size))) {
- icon->icon = NULL;
+ icon->icon = 0;
return (FALSE);
}
if ((icon->icon = XmGetPixmap(screen, icon_filename, fg, bg)) ==
XmUNSPECIFIED_PIXMAP) {
free(icon_filename);
- icon->icon = NULL;
+ icon->icon = 0;
return (FALSE);
}
if ((icon->icon_mask = _DtGetMask(screen, icon_filename)) ==
XmUNSPECIFIED_PIXMAP) {
free(icon_filename);
- icon->icon = NULL;
- icon->icon_mask = NULL;
+ icon->icon = 0;
+ icon->icon_mask = 0;
return (FALSE);
}
if (icon->icon)
XmDestroyPixmap(XtScreen(c->frame), icon->icon);
- icon->icon = NULL;
+ icon->icon = 0;
if (icon->icon_mask)
XmDestroyPixmap(XtScreen(c->frame), icon->icon_mask);
- icon->icon_mask = NULL;
+ icon->icon_mask = 0;
}
static void
if ((p->drag_icon_xbm = XmGetPixmap(s, "DtCMdnd.m.pm", fg, bg)) ==
XmUNSPECIFIED_PIXMAP) {
- p->drag_icon_xbm = NULL;
+ p->drag_icon_xbm = 0;
}
}
static void
response(Widget w, XtPointer client_data, XtPointer cbs) {
XtPointer userData = (XtPointer)0;
- int *answerP = (int *)client_data;
+ int *answerP = (int *) (intptr_t)client_data;
XtVaGetValues(w, XmNuserData, &userData, NULL);
- *answerP = (int)userData;
+ *answerP = (intptr_t)userData;
}
/*
w - pad_width,
buf, pf);
if (cm_strlen(buf) > maxchars)
- buf[maxchars] = NULL;
+ buf[maxchars] = '\0';
(void)gr_text(xc, x + pad_width,
y, pf, buf, rect);
} else {
maxchars = gr_nchars(w, buf,
pf);
if (cm_strlen(buf) > maxchars)
- buf[maxchars] = NULL;
+ buf[maxchars] = '\0';
(void)gr_text(xc, x, y, pf,
buf, rect);
}
start = (time_t) lowerbound(day);
stop = (time_t) last_dom(day);
setup_range(&range_attrs, &ops, &j, start, stop, CSA_TYPE_EVENT,
- NULL, B_FALSE, c->general->version);
+ 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);
_Xltimeparams localtime_buf;
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &start_tick);
- buf[0] = NULL;
+ buf[0] = '\0';
if (appt==NULL || !showtime_set(appt) || magic_time(start_tick))
return;
start = (time_t) lowerbound (day);
stop = (time_t) next_ndays(day, 1) - 1;
setup_range(&range_attrs, &ops, &j, start, stop,
- CSA_TYPE_EVENT, NULL, B_FALSE,
+ CSA_TYPE_EVENT, 0, B_FALSE,
c->general->version);
csa_list_entries(c->cal_handle, j, range_attrs, ops,
&a_total, &list, NULL);
lo_hour = (time_t)lowerbound (day);
hi_hour = (time_t) next_ndays(day, 1) - 1;
setup_range(&range_attrs, &ops, &j, lo_hour, hi_hour,
- 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);
quick_button_cb(Widget widget, XtPointer client, XtPointer call)
{
Calendar *c = calendar;
- int dom = (int) client;
+ int dom = (int) (intptr_t) client;
c->view->olddate = c->view->date;
c->view->date = next_ndays(first_dom(c->view->date), dom);
XmCreatePushButton(c->canvas, buf, NULL, 0);
XtVaSetValues(m->hot_button[n], XmNlabelString, str, NULL);
XtAddCallback(m->hot_button[n],XmNactivateCallback,
- quick_button_cb, (XtPointer)n);
+ quick_button_cb, (XtPointer) (intptr_t) n);
XmStringFree(str);
}
}
*/
#include <EUSCompat.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
*/
pd->report_type = PR_DAY_VIEW;
pd->report_type_option = XmVaCreateSimpleOptionMenu(pd->form,
- "TypeOptionMenu", view, NULL,
+ "TypeOptionMenu", view, 0,
pd->report_type, report_option_cb,
XmVaPUSHBUTTON, day_view, NULL, NULL, NULL,
XmVaPUSHBUTTON, week_view, NULL, NULL, NULL,
static void
report_option_cb(Widget w, XtPointer client_data, XtPointer call_data)
{
- int choice = (int) client_data;
+ int choice = (int) (intptr_t) client_data;
Calendar *c = calendar;
pd_set_report_managed(c, choice);
p->category_menu = widgets[0] =
XmVaCreateSimpleOptionMenu(p->base_form_mgr,
- "category_menu", label, NULL, 0, p_category_notify,
+ "category_menu", label, 0, 0, p_category_notify,
XmVaPUSHBUTTON, Pane_XmStrs[EDITOR_PANE], NULL, NULL, NULL,
XmVaPUSHBUTTON, Pane_XmStrs[DISPLAY_PANE], NULL, NULL, NULL,
XmVaPUSHBUTTON, Pane_XmStrs[GROUP_ACCESS_PANE], NULL, NULL,NULL,
if (save_session) {
memcpy(command + command_len, "-session", 8);
command_len += 8;
- command[command_len] = NULL;
+ command[command_len] = '\0';
command_len++;
memcpy(command + command_len, name, strlen(name));
command_len += strlen(name);
if (path) XtFree(path);
- xrm_name[1] = NULL;
+ xrm_name[1] = '\0';
/* get default view */
xrm_name[0] = XrmStringToQuark ("defaultView");
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
+#include <errno.h>
#include <sys/wait.h>
#include <LocaleXlate.h>
#include <RFCMIME.h>
}
argv[cp + 1] = NULL;
- pipe(fd);
+ if(-1 == pipe(fd)) {
+ fprintf(stderr, "pipe() failed %d '%s'\n", errno, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
c_pid = fork();
if (c_pid < 0) {
_exit(1); /* This had better never happen! */
}
else { /* The parent. */
- write(fd[1], msg, strlen(msg));
+ if(-1 == write(fd[1], msg, strlen(msg))) {
+ fprintf(stderr, "write() failed %d '%s'\n", errno, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
close(fd[0]);
close(fd[1]);
XmNvalueChangedCallback, t_view_change_proc, t);
step->next = NULL;
- step->appt = NULL;
+ step->appt = 0;
if (last) {
XtVaSetValues(step->view_item_number,
XmNtopAttachment, XmATTACH_WIDGET,
XtManageChild(step->view_item_number);
XtManageChild(step->view_item_toggle);
}
- if (step->appt != NULL)
+ if (step->appt != 0)
csa_free((CSA_buffer) step->appt);
step->appt = entry_list[cnt - 1];
step->modified = False;
** possibly filled with old stuff -- unmanage these widgets.
*/
while (step) {
- if (step->appt != NULL)
+ if (step->appt != 0)
csa_free((CSA_buffer) step->appt);
XtUnmanageChild(step->view_item_number);
XtUnmanageChild(step->view_item_toggle);
start = (time_t) lowerbound (start_date);
stop = (time_t) next_ndays(start_date, 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);
free_range(&range_attrs, &ops, j);
start = (time_t) lowerbound (start_date);
stop = (time_t) next_ndays(start_date, 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);
free_range(&range_attrs, &ops, j);
w->hot_button[n] =
XmCreatePushButton(c->canvas, "week2day", args, 1);
XtAddCallback(w->hot_button[n],XmNactivateCallback,
- quick_button_cb, (XtPointer)n);
+ quick_button_cb, (XtPointer) (intptr_t) n);
}
/* selection info (and init its permanent attributes) */
if (c->paint_cache == NULL) {
setup_range(&range_attrs, &ops, &i, start, stop, CSA_TYPE_EVENT,
- NULL, B_FALSE, c->general->version);
+ 0, B_FALSE, c->general->version);
csa_list_entries(c->cal_handle, i, range_attrs, ops,
&a_total, &list, NULL);
free_range(&range_attrs, &ops, i);
* Extract an appointment and format it into 2 lines of no more
* then maxchars
*/
- *buf1 = *buf2 = NULL;
+ *buf1 = *buf2 = '\0';
if (cache_entry == NULL || cache_entry->summary == 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);
if (maxchars >= 40) /* maxed out possible=40 */
maxchars = 40;
- buf1[0]=NULL; buf2[0]=NULL;
+ buf1[0] = '\0'; buf2[0] = '\0';
format_entry(cache_entry, buf1, buf2, dt);
tick = cache_entry->start_time;
- if (cache_entry->show_time && !magic_time(tick) && (buf1[0] != NULL)) {
+ if (cache_entry->show_time && !magic_time(tick) && (buf1[0] != '\0')) {
maxchars = gr_nchars(w->day_width - 5, buf1,c->fonts->boldfont);
- buf1[min(cm_strlen(buf1), maxchars)]=NULL;
+ buf1[min(cm_strlen(buf1), maxchars)] = '\0';
gr_text(xc, x, y, c->fonts->boldfont, buf1, rect);
nlines++;
CalFontExtents(c->fonts->boldfont, &fontextents);
if (buf2[0] != '\0') {
maxchars = gr_nchars(w->day_width - 5, buf2,
c->fonts->viewfont);
- buf2[min(cm_strlen(buf2), maxchars)]=NULL;
+ buf2[min(cm_strlen(buf2), maxchars)] = '\0';
gr_text(xc, x, y, c->fonts->viewfont, buf2, rect);
nlines++;
}
{
Calendar *c = calendar;
Week *w = (Week *)c->view->week_info;
- int dow = (int) client;
+ int dow = (int) (intptr_t) client;
char buf[BUFSIZ];
if (c->view->date != get_bot()) {
/* 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;
"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) {
{
get_time_str(appt, buf1);
- indented = (*buf1 != NULL);
+ indented = (*buf1 != '\0');
lines = text_to_lines(appt->what->value->item.string_value, 1);
line_counter++;
char *buf, *ptr;
if (type == TTY_Insert)
- fprintf(stderr, "%s %s",
+ fprintf(stderr, "%s",
catgets(catd, 1, 1042, "Insert Access Denied: "));
else if (type == TTY_Delete)
- fprintf(stderr, "%s %s",
+ fprintf(stderr, "%s",
catgets(catd, 1, 1043, "Delete Access Denied: "));
else
- fprintf(stderr, "%s %s",
+ fprintf(stderr, "%s",
catgets(catd, 1, 1044, "Lookup Access Denied: "));
if (appt_what && appt_what[0] != '\0') {
for (i = 0; i < appt->count; i++) {
if (appt->attrs[i].value->type == CSA_VALUE_REMINDER) {
if ((appt->attrs[i].value->item.reminder_value->lead_time == NULL) ||
- (appt->attrs[i].value->item.reminder_value->lead_time[0] == NULL)) {
+ (appt->attrs[i].value->item.reminder_value->lead_time[0] == '\0')) {
free(appt->attrs[i].name);
appt->attrs[i].name = NULL;
}
start = lowerbound(tick - (day * daysec));
stop = next_ndays(start, span) - 1;
setup_range(&range_attrs, &ops, &i, start, stop, CSA_TYPE_EVENT,
- NULL, B_FALSE, version);
+ 0, B_FALSE, version);
status = csa_list_entries(target, i, range_attrs, ops, &a_total, list, NULL);
free_range(&range_attrs, &ops, i);
if (appt->end_time)
format_time(end_tick, dt, end_buf);
else
- *end_buf = NULL;
+ *end_buf = '\0';
sprintf(buf, "%s%c%7s ", start_buf,
(*end_buf ? '-' : ' '), end_buf);
}
if (!strcmp(tag, "caluser")) {
vptr->type = CSA_VALUE_CALENDAR_USER;
s_ptr = strchr(value, ':');
- *s_ptr = NULL;
+ *s_ptr = '\0';
vptr->item.calendar_user_value = calloc(sizeof(CSA_calendar_user), 1);
vptr->item.calendar_user_value->user_name = cm_strdup(s_ptr + 1);
vptr->item.calendar_user_value->user_type = atoi(value);
if (!strcmp(tag, "reminder")) {
vptr->type = CSA_VALUE_REMINDER;
s_ptr = strchr(value, ':');
- *s_ptr = NULL;
+ *s_ptr = '\0';
vptr->item.reminder_value = calloc(sizeof(CSA_reminder), 1);
l_ptr = calloc(sizeof(CSA_access_rights), 1);
s_ptr = strchr(b_ptr, ':');
- *s_ptr = NULL;
+ *s_ptr = '\0';
l_ptr->rights = atoi(b_ptr);
b_ptr = s_ptr + 1;
if (s_ptr = strchr(b_ptr, '\n'))
- *s_ptr = NULL;
+ *s_ptr = '\0';
l_ptr->user->user_name = cm_strdup(b_ptr);
strcat(a_value, "\n");
strcat(a_value, b_ptr);
- a_value[strlen(a_value) - 1] = NULL;
+ a_value[strlen(a_value) - 1] = '\0';
continue;
}
b_ptr = line;
if (c_ptr = strchr(line, ':'))
{
- *c_ptr = NULL;
+ *c_ptr = '\0';
a_name = cm_strdup(b_ptr);
}
else
if (c_ptr = strchr(b_ptr, ':'))
{
- *c_ptr = NULL;
+ *c_ptr = '\0';
a_tag = cm_strdup(b_ptr);
}
else
if (!*b_ptr)
break;
else
- b_ptr[strlen(b_ptr) - 1] = NULL;
+ b_ptr[strlen(b_ptr) - 1] = '\0';
a_value = cm_strdup(b_ptr);
}
*b_ptr++ = '\t';
p_str++;
}
- *b_ptr = NULL;
+ *b_ptr = '\0';
growcat(catbuf, buf);
char tmp_buf[MAXNAMELEN];
int advance_time;
- buffer[0] = NULL;
+ buffer[0] = '\0';
for (i = 0; i < num_attrs; i++) {
if (!attrs[i].name || (attrs[i].value == NULL))
continue;
- tmp_buf[0] = NULL;
+ tmp_buf[0] = '\0';
sprintf(tmp_buf, "%s:", attrs[i].name);
switch (attrs[i].value->type) {
case CSA_VALUE_SINT32:
a_ptr = attrs[i].value->item.access_list_value;
while (a_ptr) {
sprintf(tmp_buf, "\t%d:%s\n",
- a_ptr->rights, a_ptr->user->user_name);
+ (int) a_ptr->rights, a_ptr->user->user_name);
growcat(&buffer, tmp_buf);
a_ptr = a_ptr->next;
}
CSA_uint32 repeat_times;
static char *format_string = "\n\n\t** Calendar Appointment **\n%s:string:begin\n%s%s:string:end\n\tDate: %s\n\tStart: %s\n\tEnd: %s\n\tRepeat: %s\n\tFor: %s\n\tWhat: %s";
- s_buf[0] = NULL;
- e_buf[0] = NULL;
- w_buf[0] = NULL;
- r_buf[0] = NULL;
- f_buf[0] = NULL;
+ s_buf[0] = '\0';
+ e_buf[0] = '\0';
+ w_buf[0] = '\0';
+ r_buf[0] = '\0';
+ f_buf[0] = '\0';
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &tick);
if (appt->end_time)
boolean_t compute_times = B_FALSE;
char *ps2, *ptr, *ptr2, *unit;
- *repeat_type = NULL;
+ *repeat_type = '\0';
*repeat_nth = 0;
if (ps == NULL)
return;
ps2 = cm_strdup(unit);
ptr = strchr(ps2, ' ');
if (ptr != NULL)
- *ptr = NULL;
+ *ptr = '\0';
else
return;
sprintf(pstr, "%s", periodstrings[6]);
break;
case CSA_X_DT_REPEAT_EVERY_NDAY:
- sprintf(pstr, "Every %ld %s", repeat_nth, periodstrings[7]);
+ sprintf(pstr, "Every %d %s", repeat_nth, periodstrings[7]);
break;
case CSA_X_DT_REPEAT_EVERY_NWEEK:
- sprintf(pstr, "Every %ld %s", repeat_nth, periodstrings[8]);
+ sprintf(pstr, "Every %d %s", repeat_nth, periodstrings[8]);
break;
case CSA_X_DT_REPEAT_EVERY_NMONTH:
- sprintf(pstr, "Every %ld %s", repeat_nth, periodstrings[9]);
+ sprintf(pstr, "Every %d %s", repeat_nth, periodstrings[9]);
break;
case CSA_X_DT_REPEAT_OTHER:
sprintf(pstr, "%s", periodstrings[10]);
Tick tick;
_Xltimeparams localtime_buf;
- memset(×truct, NULL, sizeof(struct tm));
+ memset(×truct, 0, sizeof(struct tm));
tm = *_XLocaltime(&t, localtime_buf);
mn = tm.tm_mon + 1;
struct tm timestruct;
- memset(×truct, NULL, sizeof(struct tm));
+ memset(×truct, 0, sizeof(struct tm));
timestruct.tm_mon = m - 1;
timestruct.tm_mday = d;
timestruct.tm_year = y - 1900;
}
#else
tmp = (char*)getenv("PRINTER");
- if (tmp != NULL && *tmp != NULL) {
+ if (tmp != NULL && *tmp != '\0') {
printer_name = (char*)malloc(strlen(tmp)+1);
strcpy(printer_name, tmp);
}
{
register int n;
- if (s==NULL) return NULL;
+ if (s==NULL) return 0;
return (strlen(s));
}
}
k++;
}
- newstr[k] = NULL;
+ newstr[k] = '\0';
return(newstr);
}
k++;
}
}
- newstr[k] = NULL;
+ newstr[k] = '\0';
return(newstr);
}
if (ptr == buf)
return(NULL);
else {
- *ptr = NULL;
+ *ptr = '\0';
return(cm_strdup(buf));
}
}
#if defined(sun) || defined(USL) || defined(__uxp__)
sysinfo(SI_SRPC_DOMAIN, local_domain, DOM_NM_LN);
#else
- (void) getdomainname(local_domain, BUFSIZ);
+ if(-1 == getdomainname(local_domain, BUFSIZ)) {
+ fprintf(stderr, "getdomainname() failed %d '%s'\n", errno, strerror(errno));
+ }
+
#endif /* sun || USL || __uxp__ */
}
return(local_domain);
get_component(&str2, com2, '.');
if (*com1) {
- if (*com2 == NULL)
+ if (*com2 == '\0')
return (B_TRUE);
} else {
- if (*com2 == NULL)
+ if (*com2 == '\0')
return (B_TRUE);
else
return (B_FALSE);
/* take care of case: a.b a. */
if (strcmp(str2, ".") == 0
- && (strcmp(str1, ".") != 0 || *str1 != NULL))
+ && (strcmp(str1, ".") != 0 || *str1 != '\0'))
return (B_FALSE);
/* skip "." */
if (*str1 == '.') {
- if (*str2 == NULL)
+ if (*str2 == '\0')
return (B_TRUE);
else {
str1++;
str2++;
}
- } else if (strcmp(str2, ".") == 0 || *str2 == NULL)
+ } else if (strcmp(str2, ".") == 0 || *str2 == '\0')
return (B_TRUE);
else
return (B_FALSE);
get_last_component(str2, &ptr2, com2, '.');
if (*com1) {
- if (*com2 == NULL)
+ if (*com2 == '\0')
return (B_TRUE);
} else {
- if (*com2 == NULL)
+ if (*com2 == '\0')
return (B_TRUE);
else
return (B_FALSE);
char *tmp_date, *str = separator_str(sep);
_Xstrtokparams strtok_buf;
- m[0] = NULL;
- d[0] = NULL;
- y[0] = NULL;
+ m[0] = '\0';
+ d[0] = '\0';
+ y[0] = '\0';
if (datestr == NULL)
return 0;
datestr2mdy(char *datestr, OrderingType order, SeparatorType sep, char *buf) {
char m[3], d[3], y[5];
- buf[0] = NULL;
+ buf[0] = '\0';
if (datestr == NULL)
return 0;
struct tm *tm;
_Xltimeparams localtime_buf;
- buff[0] = NULL;
+ buff[0] = '\0';
tm = _XLocaltime(&tick, localtime_buf);
switch (order) {
boolean_t am;
if (t == 0) {
- sprintf(buffer, "\0");
+ buffer[0] = '\0';
} else if (dt == HOUR12) {
am = adjust_hour(&hr);
*/
idx = sizeof(Dtcm_appointment);
appt = (Dtcm_appointment *)ckalloc(idx);
- memset(appt, NULL, idx);
+ memset(appt, 0, idx);
appt->reason = reason;
appt->version = version;
api_idx = va_arg(pvar, int);
while (api_idx) {
if ((reason == appt_read) || !entry_ident_index_ro(api_idx, version))
- CmDataListAdd(api_ids, (void *)api_idx, 0);
+ CmDataListAdd(api_ids, (void *) (intptr_t) api_idx, 0);
api_idx = va_arg(pvar, int);
}
va_end(pvar);
for (idx = 0; idx < def_attr_count; idx++) {
if ((reason == appt_write) && entry_ident_index_ro(default_appt_attrs[idx], version))
continue;
- CmDataListAdd(api_ids, (void *)default_appt_attrs[idx], 0);
+ CmDataListAdd(api_ids, (void *) (intptr_t) default_appt_attrs[idx], 0);
}
}
appt->num_names = api_ids->count;
idx = sizeof(CSA_attribute_reference *) * appt->num_names;
appt->names = (CSA_attribute_reference *)ckalloc(idx);
- memset(appt->names, NULL, idx);
+ memset(appt->names, 0, idx);
appt->count = api_ids->count;
if (reason == appt_write) {
idx = sizeof(CSA_attribute) * appt->count;
appt->attrs = (CSA_attribute *)ckalloc(idx);
- memset(appt->attrs, NULL, idx);
+ memset(appt->attrs, 0, idx);
}
/*
* Now loop through and set the names and initialize the attributes
*/
for (idx = 0; idx < appt->count; idx++) {
- api_idx = (int)CmDataListGetData(api_ids, idx + 1);
+ api_idx = (int) (intptr_t) CmDataListGetData(api_ids, idx + 1);
appt->names[idx] = strdup(_CSA_entry_attribute_names[api_idx]);
if (reason == appt_write)
initialize_entry_attr(api_idx, &appt->attrs[idx], reason, version);
if (reason == appt_write)
set_appt_links(appt);
- CmDataListDestroy(api_ids, NULL);
+ CmDataListDestroy(api_ids, 0);
return appt;
}
*/
idx = sizeof(Dtcm_calendar);
cal = (Dtcm_calendar *)ckalloc(idx);
- memset(cal, NULL, idx);
+ memset(cal, 0, idx);
cal->reason = reason;
cal->version = version;
api_idx = va_arg(pvar, int);
while (api_idx) {
if ((reason == appt_read) || !cal_ident_index_ro(api_idx, version))
- CmDataListAdd(api_ids, (void *)api_idx, 0);
+ CmDataListAdd(api_ids, (void *) (intptr_t) api_idx, 0);
api_idx = va_arg(pvar, int);
}
va_end(pvar);
for (idx = 0; idx < DEF_CAL_ATTR_COUNT; idx++) {
if ((reason == appt_write) && cal_ident_index_ro(default_cal_attrs[idx], version))
continue;
- CmDataListAdd(api_ids, (void *)default_cal_attrs[idx], 0);
+ CmDataListAdd(api_ids, (void *) (intptr_t) default_cal_attrs[idx], 0);
}
}
cal->num_names = api_ids->count;
idx = sizeof(CSA_attribute_reference) * cal->num_names;
cal->names = (CSA_attribute_reference *)ckalloc(idx);
- memset(cal->names, NULL, idx);
+ memset(cal->names, 0, idx);
cal->count = api_ids->count;
if (reason == appt_write) {
idx = sizeof(CSA_attribute) * cal->count;
cal->attrs = (CSA_attribute *)ckalloc(idx);
- memset(cal->attrs, NULL, idx);
+ memset(cal->attrs, 0, idx);
}
/*
* Now loop through and set the names and initialize the attributes
*/
for (idx = 0; idx < cal->count; idx++) {
- api_idx = (int)CmDataListGetData(api_ids, idx + 1);
+ api_idx = (int) (intptr_t) CmDataListGetData(api_ids, idx + 1);
cal->names[idx] = strdup(_CSA_calendar_attribute_names[api_idx]);
if (reason == appt_write)
initialize_cal_attr(api_idx, &cal->attrs[idx], reason, version);
if (reason == appt_write)
set_cal_links(cal);
- CmDataListDestroy(api_ids, NULL);
+ CmDataListDestroy(api_ids, 0);
return cal;
for (i = 0; i < cal->count; i++) {
if (cal->attrs[i].value->type == CSA_VALUE_REMINDER) {
if ((cal->attrs[i].value->item.reminder_value->lead_time == NULL) ||
- (cal->attrs[i].value->item.reminder_value->lead_time[0] == NULL)) {
+ (cal->attrs[i].value->item.reminder_value->lead_time[0] == '\0')) {
free(cal->attrs[i].name);
cal->attrs[i].name = NULL;
}
if ((reason == appt_write) && !cal_ident_index_ro(id, version)) {
size = sizeof(CSA_attribute_value);
attrs->value = (CSA_attribute_value *)ckalloc(size);
- memset(attrs->value, NULL, size);
+ memset(attrs->value, 0, size);
attrs->value->type = cal_ident_index_tag(id);
if (attrs->value->type == CSA_VALUE_REMINDER)
attrs->value->item.reminder_value = (CSA_reminder *) calloc(sizeof(CSA_reminder), 1);
if ((reason == appt_write) && !entry_ident_index_ro(id, version)) {
size = sizeof(CSA_attribute_value);
attrs->value = (CSA_attribute_value *)ckalloc(size);
- memset(attrs->value, NULL, size);
+ memset(attrs->value, 0, size);
attrs->value->type = entry_ident_index_tag(id);
if (attrs->value->type == CSA_VALUE_REMINDER)
attrs->value->item.reminder_value = (CSA_reminder *) calloc(sizeof(CSA_reminder), 1);
a_size = sizeof(CSA_attribute) * (*count);
attr_ptr = (CSA_attribute *)ckalloc(a_size);
- memset(attr_ptr, NULL, a_size);
+ memset(attr_ptr, 0, a_size);
o_size = sizeof(CSA_enum) * (*count);
op_ptr = (CSA_enum *)ckalloc(o_size);
- memset(op_ptr, NULL, o_size);
+ memset(op_ptr, 0, o_size);
initialize_entry_attr(CSA_ENTRY_ATTR_START_DATE_I, &attr_ptr[0], appt_write, version);
attr_ptr[0].value->item.string_value = malloc(BUFSIZ);
if (newid > 0)
sprintf(nbuf, "%ld", newid);
else
- nbuf[0] = NULL;
+ nbuf[0] = '\0';
udata.newid = nbuf;
udata.scope = scope;
udata.time = time;
if ((cal->types = (int *)calloc(1, sizeof(int) *
(_DtCm_entry_name_tbl->size + 1))) == NULL) {
_DtCmsFreeCalendar(cal);
- return (NULL);
+ return (0);
} else
_DtCm_get_attribute_types(_DtCm_entry_name_tbl->size,
cal->types);
_DtCmsCalendar *clist = calendar_list;
if ((name = get_calname(target)) == NULL)
- return (NULL);
+ return (0);
while (clist != NULL) {
if (strcmp (name, clist->calendar) == 0) {
if (ptr == NULL) {
return (strdup(target));
} else {
- *ptr = NULL;
+ *ptr = '\0';
name = strdup(target);
*ptr = '@';
return (name);
/* use passed in char set if client does not supply one */
if (cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value == NULL &&
- args->char_set && *args->char_set != NULL) {
+ args->char_set && *args->char_set != '\0') {
if ((stat = _DtCm_set_string_attrval(args->char_set,
&cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value,
CSA_VALUE_STRING)) != CSA_SUCCESS) {
void *nptr;
if (nptr = realloc(ptr, newcount)) {
- memset((void *)((char *)nptr + oldcount), NULL,
+ memset((void *)((char *)nptr + oldcount), 0,
newcount - oldcount);
return (nptr);
} else
#define TVAL(a,b) { #a,-1, -1, &externTag.tag,b,TAGSVAL }
#define SVAL(a,b) { #a,-1, -1, &externPrivacy,b,PRIVACYVAL}
-#define EMP(a,b) {#a,-1, -1, NULL,NULL,b}
+#define EMP(a,b) {#a,-1, -1, 0, 0,b}
token_data_t tokens[] = {
PVAL(single, single_4),
unput_char();
- *ptr = NULL;
+ *ptr = '\0';
externNumberVal=atoi((char *)parse_buffer);
return(NUMBER);
unput_char();
- *ptr = NULL;
+ *ptr = '\0';
if ((bucket = tokens[hash_string((char *) parse_buffer)].first_token)
== -1) {
and 1 BUFSIZ for the rest */
cptr = ctime (&appt->appt_id.tick);
- cptr[24] = NULL; /* strip off CR */
+ cptr[24] = '\0'; /* strip off CR */
- buf[0] = NULL;
+ buf[0] = '\0';
switch (op) {
case _DtCmsLogAdd:
sprintf(buf, "(add \"%s\" key: %ld ", cptr, appt->appt_id.key);
}
if (appt->period.enddate != 0) {
cptr = ctime (&(appt->period.enddate));
- cptr[24] = NULL; /* strip off CR */
+ cptr[24] = '\0'; /* strip off CR */
sprintf(buf2, "enddate: \"%s\" ", cptr);
strcat(buf, buf2);
}
fprintf(stderr, "*** V4 appointement: ***\n\n");
tmstr = ctime (&appt->appt_id.tick);
- tmstr[24] = NULL; /* strip off CR */
+ tmstr[24] = '\0'; /* strip off CR */
if (fprintf(stderr, "(add \"%s\" ", tmstr)==EOF) {
return (B_TRUE);
return (B_TRUE);
}
- buf[0]=NULL;
+ buf[0] = '\0';
periodtostr (appt->period.period, buf);
if (fprintf(stderr, "period: %s ", buf) == EOF)
return (B_TRUE);
}
if (appt->period.enddate != 0) {
tmstr = ctime (&(appt->period.enddate));
- tmstr[24] = NULL; /* strip off CR */
+ tmstr[24] = '\0'; /* strip off CR */
if (fprintf(stderr, "enddate: \"%s\" ", tmstr) == EOF)
return (B_TRUE);
}
if (fprintf(stderr, "tags: (") == EOF)
return (B_TRUE);
while(item != NULL) {
- buf[0]=NULL;
+ buf[0] = '\0';
tagstostr(item->tag, buf);
if (fprintf(stderr, "(%s , %d)", buf, item->showtime)
== EOF)
}
- buf[0]=NULL;
+ buf[0] = '\0';
apptstatustostr(appt->appt_status, buf);
if (fprintf(stderr, "apptstat: %s ", buf) == EOF)
return (B_TRUE);
- buf[0]=NULL;
+ buf[0] = '\0';
privacytostr(appt->privacy, buf);
if (fprintf(stderr, "privacy: %s )\n", buf) == EOF)
return (B_TRUE);
return;
/* truncate log file to specified size */
- if ((f = open(log, O_RDWR | O_APPEND | O_SYNC)) >= 0)
- ftruncate(f, size);
+ if ((f = open(log, O_RDWR | O_APPEND | O_SYNC)) >= 0) {
+ if(-1 == ftruncate(f, size)) {
+ perror(strerror(errno));
+ }
+ }
free(log);
}
tmval = time((time_t *) 0);
tm = _XLocaltime(&tmval, localtime_buf);
tmstr = _XAsctime(tm, asctime_buf);
- tmstr[24] = NULL; /* strip off CR */
+ tmstr[24] = '\0'; /* strip off CR */
if ((fd = open(file, O_WRONLY|O_TRUNC|O_SYNC)) < 0) {
if (debug)
- fprintf(stderr, "%s: failed to open %s in %s\n",
- pgname, file, _DtCmsWriteVersionString);
+ fprintf(stderr, "%s: failed to open %s\n",
+ pgname, file);
return (CSA_X_DT_E_BACKING_STORE_PROBLEM);
}
#ifdef HPUX
setuid (0);
#else
- seteuid (0);
+ if(-1 == seteuid (0)) {
+ perror(strerror(errno));
+ }
#endif
#endif
}
periodtostr(Interval_4 i, char *q)
{
if (q==NULL) return;
- q[0]=NULL;
+ q[0] = '\0';
switch (i) {
case single_4:
strcpy (q, "single");
privacytostr(Privacy_Level_4 p, char *q)
{
if (q==NULL) return;
- q[0]=NULL;
+ q[0] = '\0';
switch(p) {
case public_4:
strcpy(q, "public");
apptstatustostr(Appt_Status_4 p, char *q)
{
if (q==NULL) return;
- q[0]=NULL;
+ q[0] = '\0';
switch(p) {
case active_4:
strcpy(q, "active");
tagstostr(Event_Type_4 p, char *q)
{
if (q==NULL) return;
- q[0]=NULL;
+ q[0] = '\0';
switch(p) {
case appointment_4:
strcpy(q, "appointment");
CSA_return_code stat;
ptr = strchr(owner, '@');
- if (ptr) *ptr = NULL;
+ if (ptr) *ptr = '\0';
pw = getpwnam (owner);
if (ptr) *ptr = '@';
if (pw == NULL)
status = CSA_X_DT_E_BACKING_STORE_PROBLEM;
perror(pgname);
- ftruncate(f, file_size);
+ if(-1 == ftruncate(f, file_size)) {
+ perror(strerror(errno));
+ status = CSA_X_DT_E_BACKING_STORE_PROBLEM;
+ }
return (status);
}
if ((buf = malloc(BUFSIZ+1)) == NULL) return (NULL);
tcount = BUFSIZ;
- for (i = 1, count = 0, *buf = NULL; i <= num_attr; i++) {
+ for (i = 1, count = 0, *buf = '\0'; i <= num_attr; i++) {
if (attrs[i].value == NULL || (entryattrs &&
(i == CSA_ENTRY_ATTR_NUMBER_RECURRENCES_I ||
/* value string */
body = NULL;
- *tmpbuf2 = NULL;
+ *tmpbuf2 = '\0';
switch (attrs[i].value->type) {
case CSA_VALUE_ENUMERATED:
case CSA_VALUE_SINT32:
tcount += BUFSIZ;
}
strcat(buf, tmpbuf);
- if (*tmpbuf2 != NULL) strcat(buf, tmpbuf2);
+ if (*tmpbuf2 != '\0') strcat(buf, tmpbuf2);
if (body) strcat(buf, body);
strcat(buf, "\")\n");
if (body) free(body);
k++;
}
}
- newstr[k] = NULL;
+ newstr[k] = '\0';
return(newstr);
}
newp->author = $12;
newp->attr = $13;
- if (temp != NULL && (*temp)!=NULL) {
+ if (temp != NULL && (*temp)!='\0') {
item = newp->attr;
while(item!=NULL) {
if(strcmp(item->attr, "ml")==0) {
duration : /* empty */
{
- $$ = NULL;
+ $$ = '\0';
}
| DURATION COLON number
{
}
k++;
}
- newstr[k] = NULL;
+ newstr[k] = '\0';
return(newstr);
}
if (datestr == NULL)
return (-1);
- memset((void *)&tmstr, NULL, sizeof(struct tm));
+ memset((void *)&tmstr, 0, sizeof(struct tm));
strcpy(datebuf, datestr);
if ((tptr = strchr(ptr, ':')) == NULL)
return (-1);
else {
- *tptr = NULL;
+ *tptr = '\0';
tmstr.tm_hour = atoi(ptr);
}
if ((tptr = strchr(ptr, ':')) == NULL)
return (-1);
else {
- *tptr = NULL;
+ *tptr = '\0';
tmstr.tm_min = atoi(ptr);
}
stat = _DtCm_set_string_attrval(valstr, attrval, type);
break;
case CSA_VALUE_REMINDER:
- memset((void *)&remval, NULL, sizeof (CSA_reminder));
+ memset((void *)&remval, 0, sizeof (CSA_reminder));
if (ptr1 = strchr(valstr, ':')) {
- *ptr1++ = NULL;
+ *ptr1++ = '\0';
if (ptr2 = strchr(ptr1, ':')) {
- *ptr2++ = NULL;
+ *ptr2++ = '\0';
ptr3 = strchr(ptr2, ':');
}
}
stat = _DtCm_set_reminder_attrval(&remval, attrval);
} else {
/* format = "string:string:number:number:string" */
- *ptr3++ = NULL;
+ *ptr3++ = '\0';
if (ptr4 = strchr(ptr3, ':')) {
- *ptr4++ = NULL;
+ *ptr4++ = '\0';
remval.lead_time = valstr;
remval.snooze_time = ptr1;
remval.repeat_count = atoi(ptr2);
break;
case CSA_VALUE_OPAQUE_DATA:
if (ptr1 = strchr(valstr, ':')) {
- *ptr1++ = NULL;
+ *ptr1++ = '\0';
opqval.size = atoi(valstr);
opqval.data = (unsigned char *)ptr1;
stat = _DtCm_set_opaque_attrval(&opqval, attrval);
return (CSA_E_INSUFFICIENT_MEMORY);
}
- *ptr = NULL;
+ *ptr = '\0';
if ((item->user = strdup(string)) == NULL) {
free(item);
return (CSA_E_INSUFFICIENT_MEMORY);
attrs->total += _DEFAULT_ARRAY_SIZE;
attrs->attrs = newptr;
- memset((void *)&attrs->attrs[attrs->current], NULL,
+ memset((void *)&attrs->attrs[attrs->current], 0,
sizeof(cms_attribute)*_DEFAULT_ARRAY_SIZE);
}
if (_target_time) {
if (!(unused = InitRepeatEventState(re)))
return (Tick)NULL;
- start_time = DoWeek(NULL, _start_time, re, unused);
+ start_time = DoWeek(0, _start_time, re, unused);
free(unused);
if (_target_time < start_time)
target_time = start_time;
if (_target_time) {
if (!(unused = InitRepeatEventState(re)))
return (Tick)NULL;
- start_time = DoYearByMonth(NULL, _start_time, re, unused);
+ start_time = DoYearByMonth(0, _start_time, re, unused);
free(unused);
if (_target_time < start_time)
target_time = start_time;
if (_target_time) {
if (!(unused = InitRepeatEventState(re)))
return (Tick)NULL;
- start_time = DoYearByDay(NULL, _start_time, re, unused);
+ start_time = DoYearByDay(0, _start_time, re, unused);
free(unused);
if (_target_time < start_time)
target_time = start_time;
31*daysec, 30*daysec, 31*daysec
};
-extern int monthdays[12] = {
+int monthdays[12] = {
31, 28, 31,
30, 31, 30,
31, 31, 30,
strcat (cmd_buf, subcommand);
}
- memset (subcommand, NULL, 1024);
+ memset (subcommand, 0, 1024);
re = re->re_next;
}
* time should be.
*/
while (--num_events &&
- (an_event = PrevTick(an_event, NULL, new_re, res))) {
+ (an_event = PrevTick(an_event, 0, new_re, res))) {
;
}
}
minute = atoi(×tr[len - 2]);
- timestr[len - 2] = NULL;
+ timestr[len - 2] = '\0';
hour = atoi(timestr);
if (hour > 23 || minute > 59)
}
/* Change current directory, so core file can be dumped. */
- chdir (dir);
+ if(-1 == chdir (dir)) {
+ perror(strerror(errno));
+ }
}
/*
setgid (daemon_gid);
setuid (daemon_uid);
#else
- setegid (daemon_gid);
- seteuid (daemon_uid);
+ if(-1 == setegid (daemon_gid)) {
+ perror(strerror(errno));
+ }
+ if(-1 == seteuid (daemon_uid)) {
+ perror(strerror(errno));
+ }
#endif /* HPUX */
#endif /* AIX */
sprintf(buf, "#%d", remain);
if (ptr = strchr(vptr->item.string_value, '#')) {
- *ptr = NULL;
+ *ptr = '\0';
strcpy(newrule, vptr->item.string_value);
strcat(newrule, buf);
if (ptr = strchr(ptr + 1, ' '))
strcat(newrule, ptr);
} else {
if (ptr = strchr(vptr->item.string_value, ' ')) {
- *ptr = NULL;
+ *ptr = '\0';
sprintf(newrule, "%s %s %s", vptr->item.string_value,
buf, ptr+1);
} else