1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtcm: Resolve 303 compiler warnings.

This commit is contained in:
Peter Howkins 2015-01-13 14:22:25 +00:00
parent fe39b630b3
commit 8baeb4c0a0
44 changed files with 275 additions and 250 deletions

View file

@ -389,7 +389,7 @@ Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args )
if (new_w->month_panel.active_days) { if (new_w->month_panel.active_days) {
btn = XmCreatePushButtonGadget((Widget)new_w, buf, wargs, 1); btn = XmCreatePushButtonGadget((Widget)new_w, buf, wargs, 1);
XtAddCallback(btn, XmNactivateCallback, DayCallback, XtAddCallback(btn, XmNactivateCallback, DayCallback,
(XtPointer)(i+1)); (XtPointer) (intptr_t) (i+1));
} }
else { else {
btn = XmCreateLabelGadget((Widget) new_w, buf, wargs, 1); btn = XmCreateLabelGadget((Widget) new_w, buf, wargs, 1);
@ -906,7 +906,7 @@ static void DayCallback(Widget w, XtPointer client, XtPointer call)
XmMonthPanelCallbackStruct data; XmMonthPanelCallbackStruct data;
data.type = DAY_SELECTION; data.type = DAY_SELECTION;
data.day = (int) client; data.day = (intptr_t) client;
XtCallCallbackList((Widget) mp, mp->month_panel.callback, &data); XtCallCallbackList((Widget) mp, mp->month_panel.callback, &data);
} }

View file

@ -248,7 +248,7 @@ blist_name_append(Calendar *c, char *name, BlistTag t) {
bd = (BlistData *)ckalloc(sizeof(BlistData)); bd = (BlistData *)ckalloc(sizeof(BlistData));
bd->name = cm_strdup(name); bd->name = cm_strdup(name);
bd->tag = t; bd->tag = t;
bd->cal_handle = NULL; bd->cal_handle = 0;
CmDataListAdd(bl->blist_data, (void *)bd, location); CmDataListAdd(bl->blist_data, (void *)bd, location);
return location; return location;
@ -290,7 +290,7 @@ blist_addname(Widget widget, XtPointer client_data, XtPointer cbs) {
((*(end_ptr - 1) == ' ') || (*(end_ptr - 1) == '\t'))) ((*(end_ptr - 1) == ' ') || (*(end_ptr - 1) == '\t')))
end_ptr--; end_ptr--;
*end_ptr = NULL; *end_ptr = '\0';
if (blank_buf(new_name)) { if (blank_buf(new_name)) {
@ -453,7 +453,7 @@ blist_init_names(Calendar *c) {
blist_name_append(c, get_char_prop(p, CP_DEFAULTCAL), BLIST_ACTIVE); blist_name_append(c, get_char_prop(p, CP_DEFAULTCAL), BLIST_ACTIVE);
namelist = cm_strdup(get_char_prop(p, CP_DAYCALLIST)); namelist = cm_strdup(get_char_prop(p, CP_DAYCALLIST));
if (namelist == NULL || *namelist == NULL ) if (namelist == NULL || *namelist == '\0' )
return; return;
name = strtok(namelist, " "); name = strtok(namelist, " ");
@ -496,7 +496,7 @@ blist_clean(Browselist *bl, Boolean clean_all) {
cnt = bl->blist_data->count; cnt = bl->blist_data->count;
for (i = 1; i <= cnt; i++) { for (i = 1; i <= cnt; i++) {
bd = (BlistData *)CmDataListGetData(bl->blist_data, left_cnt); 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)) { (clean_all || bd->tag != BLIST_ACTIVE)) {
if (bd->name) if (bd->name)
free(bd->name); free(bd->name);

View file

@ -376,7 +376,7 @@ make_browser(Calendar *c)
* remember - this returns a RowColumn widget! * remember - this returns a RowColumn widget!
*/ */
b->gotomenu = XmVaCreateSimpleOptionMenu(b->upper_form, 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, prev_week, NULL, NULL, NULL,
XmVaPUSHBUTTON, this_week, NULL, NULL, NULL, XmVaPUSHBUTTON, this_week, NULL, NULL, NULL,
XmVaPUSHBUTTON, next_week, NULL, NULL, NULL, XmVaPUSHBUTTON, next_week, NULL, NULL, NULL,
@ -749,7 +749,7 @@ void mb_update_busystatus(Browser *b, Calendar *c)
if (bd->cache == NULL) { if (bd->cache == NULL) {
setup_range(&range_attrs, &ops, &r_cnt, start, stop, 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); stat = csa_list_entries(bd->cal_handle, r_cnt, range_attrs, ops, &num_entries, &entries, NULL);
free_range(&range_attrs, &ops, r_cnt); free_range(&range_attrs, &ops, r_cnt);
backend_err_msg(b->frame, bd->name, stat, backend_err_msg(b->frame, bd->name, stat,
@ -884,7 +884,7 @@ get_mail_address_list(Calendar *c) {
} }
address = calloc(address_len+1, 1); address = calloc(address_len+1, 1);
address[0] = NULL; address[0] = '\0';
for (i = 0; i < pos_cnt; i++) { for (i = 0; i < pos_cnt; i++) {
bd = (BlistData *)CmDataListGetData(bl->blist_data, bd = (BlistData *)CmDataListGetData(bl->blist_data,
@ -972,7 +972,7 @@ nt */
static void static void
gotomenu_cb(Widget w, XtPointer data, XtPointer cbs) 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 */ /* should really be getting this from the widget */
Calendar *c = calendar; Calendar *c = calendar;
@ -1061,7 +1061,7 @@ mb_update_array(char *entry_text, Calendar *c)
if (bd->cache == NULL) { if (bd->cache == NULL) {
setup_range(&range_attrs, &ops, &r_cnt, start, setup_range(&range_attrs, &ops, &r_cnt, start,
stop, CSA_TYPE_EVENT, 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, stat = csa_list_entries(bd->cal_handle, r_cnt, range_attrs,
ops, &num_entries, &entries, NULL); ops, &num_entries, &entries, NULL);
free_range(&range_attrs, &ops, r_cnt); free_range(&range_attrs, &ops, r_cnt);
@ -1216,7 +1216,7 @@ mb_deregister_names(char *name, Calendar *c)
backend_err_msg(b->frame, bd->name, stat, backend_err_msg(b->frame, bd->name, stat,
p->xm_error_pixmap); p->xm_error_pixmap);
} }
bd->cal_handle = NULL; bd->cal_handle = '\0';
blist_clean(bl, False); blist_clean(bl, False);
} }
} }

View file

@ -964,25 +964,25 @@ set_default_view(Calendar *c)
*/ */
void view_day_cb(Widget w, XtPointer data, XtPointer cbs) void view_day_cb(Widget w, XtPointer data, XtPointer cbs)
{ {
if ((int) data == 0) if ((intptr_t) data == 0)
day_button(w, data, cbs); day_button(w, data, cbs);
} }
void view_week_cb(Widget w, XtPointer data, XtPointer 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); week_button(w, data, cbs);
} }
void view_month_cb(Widget w, XtPointer data, XtPointer 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); month_button(w, data, cbs);
} }
void view_year_cb( Widget w, XtPointer data, XtPointer 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); (void) year_button(w, data, cbs);
} }
@ -1112,9 +1112,9 @@ edit_cb( Widget w, XtPointer item_no, XtPointer cbs)
Calendar *c = calendar; Calendar *c = calendar;
_DtTurnOnHourGlass(c->frame); _DtTurnOnHourGlass(c->frame);
if ((int) item_no == 1) if ((intptr_t) item_no == 1)
show_props_pu(c); show_props_pu(c);
else if ((int) item_no == 3) else if ((intptr_t) item_no == 3)
make_find(c); make_find(c);
_DtTurnOffHourGlass(c->frame); _DtTurnOffHourGlass(c->frame);
} }
@ -1175,7 +1175,7 @@ appt_cb(Widget w, XtPointer item_no, XtPointer cbs)
Calendar *c = calendar; Calendar *c = calendar;
_DtTurnOnHourGlass(c->frame); _DtTurnOnHourGlass(c->frame);
switch((int) item_no) { switch((intptr_t) item_no) {
case 0: case 0:
show_editor(c, 0, 0, False); show_editor(c, 0, 0, False);
break; break;
@ -1223,7 +1223,7 @@ edit_menu_cb(Widget w, XtPointer cl_data, XtPointer cbs)
static void static void
browse_cb(Widget w, XtPointer client_data, XtPointer cbs) { 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]; char buf[MAXNAMELEN];
Calendar *c = calendar; Calendar *c = calendar;
Props_pu *p = (Props_pu *)c->properties_pu; Props_pu *p = (Props_pu *)c->properties_pu;
@ -1556,7 +1556,7 @@ update_browse_menu_names(Calendar *c) {
str = (!strcmp(bd->name, c->calname)) ? "calName" : "myName"; str = (!strcmp(bd->name, c->calname)) ? "calName" : "myName";
item = XmCreatePushButtonGadget(c->browse_menu, str, al, ac); item = XmCreatePushButtonGadget(c->browse_menu, str, al, ac);
XtAddCallback(item, XmNactivateCallback, browse_cb, XtAddCallback(item, XmNactivateCallback, browse_cb,
(XtPointer)i); (XtPointer) (intptr_t) i);
XmStringFree(xmstr); XmStringFree(xmstr);
} }
@ -2160,12 +2160,12 @@ open_user_calendar(Calendar *c, Boolean retry)
NULL, NULL); NULL, NULL);
/* create the calendar */ /* 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) { == CSA_E_UNSUPPORTED_ATTRIBUTE) {
/* server with version 4 or less does not support /* server with version 4 or less does not support
* the CSA_CAL_ATTR_CHARACTER_SET cal attribute * 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); NULL);
} }
if (val.item.string_value) free(val.item.string_value); if (val.item.string_value) free(val.item.string_value);
@ -2294,7 +2294,7 @@ logon_retry(XtPointer data, XtIntervalId *dummy)
{ {
Calendar *c = (Calendar *)data; Calendar *c = (Calendar *)data;
/* retry once */ /* 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); _DtTurnOnHourGlass(c->frame);
reset_timer(c); reset_timer(c);
@ -2461,7 +2461,7 @@ get_user_calendar()
uname = cm_get_uname(); uname = cm_get_uname();
if ((loc = get_char_prop((Props *)calendar->properties, CP_CALLOC)) && if ((loc = get_char_prop((Props *)calendar->properties, CP_CALLOC)) &&
*loc != NULL) { *loc != '\0') {
loc = strdup(loc); loc = strdup(loc);
needfree = True; needfree = True;
} else } else
@ -2559,7 +2559,7 @@ init_calendar(argc, argv)
while (*s_ptr) while (*s_ptr)
*d_ptr++ = *s_ptr++; *d_ptr++ = *s_ptr++;
*d_ptr++ = NULL; *d_ptr++ = '\0';
} }
d_ptr = NULL; d_ptr = NULL;

View file

@ -118,7 +118,7 @@ cm_args(int argc, char **argv)
argv = grab(++argv,cm_view,'-'); argv = grab(++argv,cm_view,'-');
break; break;
default: 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); exit(1);
} }
} }
@ -186,7 +186,7 @@ int main(int argc, char **argv)
free(loc); free(loc);
exit(0); exit(0);
} }
fprintf(stdout, catgets(DT_catd, 1, 190, fprintf(stdout, "%s", catgets(DT_catd, 1, 190,
"Item to delete (number)? ")); "Item to delete (number)? "));
fgets(index, 9, stdin); fgets(index, 9, stdin);
fprintf(stdout,"\n\n"); fprintf(stdout,"\n\n");

View file

@ -225,7 +225,7 @@ prompt_for_insert(Props *p) {
printf("%s", 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")); "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++) for (index = 0; index < 5; index++)
{ {
*what_buffer = '\0'; *what_buffer = '\0';

View file

@ -115,7 +115,7 @@ cm_args(int argc, char **argv)
argv = grab(++argv,cm_view,'-'); argv = grab(++argv,cm_view,'-');
break; break;
default: 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); exit(1);
} }
} }

View file

@ -211,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++) { for (i = begin_time - 1; i < end_time; i++) {
hr = i; hr = i;
if (i < begin_time) if (i < begin_time)
(void) sprintf(buf, ""); buf[0] = '\0';
else if (disp_t == HOUR12) { else if (disp_t == HOUR12) {
am = adjust_hour(&hr); am = adjust_hour(&hr);
(void) sprintf(buf, "%d%s", hr, am ? "a" : "p"); (void) sprintf(buf, "%d%s", hr, am ? "a" : "p");
@ -267,7 +267,7 @@ paint_dayview_appts(Calendar *c, Paint_cache *cache, int a_total, void *rect)
appt_str, end_tick, appt_str, end_tick,
cache[i].show_time, disp_t); 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] /* REVISIT: unclear why we're still distinguishing between gr_text[_rgb]
if (c->xcontext->screen_depth >= 8) if (c->xcontext->screen_depth >= 8)
@ -337,7 +337,7 @@ paint_dayview_appts(Calendar *c, Paint_cache *cache, int a_total, void *rect)
appt_str, end_tick, appt_str, end_tick,
cache[i].show_time, disp_t); 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] /* REVISIT: unclear why we're still distinguishing between gr_text[_rgb]
if (c->xcontext->screen_depth >= 8) if (c->xcontext->screen_depth >= 8)
@ -620,7 +620,7 @@ paint_dayview(Calendar *c, Boolean repaint, XRectangle *rect, Boolean update_mon
if (c->paint_cache == NULL) { if (c->paint_cache == NULL) {
start = (time_t) lower_bound(0, c->view->date); start = (time_t) lower_bound(0, c->view->date);
stop = (time_t) next_nhours(start, end+1) - 1; 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); B_FALSE, c->general->version);
csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL); csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL);
@ -811,7 +811,7 @@ count_day_pages(Calendar *c, int lines_per_page, Tick tick)
start = (time_t) lower_bound(i, tick); start = (time_t) lower_bound(i, tick);
end = (time_t) next_nhours(start+1, 1) - 1; end = (time_t) next_nhours(start+1, 1) - 1;
setup_range(&range_attrs, &ops, &j, start, end, 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); csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL);
free_range(&range_attrs, &ops, j); free_range(&range_attrs, &ops, j);
@ -888,7 +888,7 @@ _print_day(Calendar *c,
start = (time_t) lower_bound(i, tick); start = (time_t) lower_bound(i, tick);
stop = (time_t) next_nhours(start+1, 1) - 1; stop = (time_t) next_nhours(start+1, 1) - 1;
setup_range(&range_attrs, &ops, &j, start, stop, 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, csa_list_entries(c->cal_handle, j, range_attrs,
ops, &a_total, &list, NULL); ops, &a_total, &list, NULL);

View file

@ -178,7 +178,7 @@ handle_animate_cb(
drag_load_proc(dnd_filename, c); drag_load_proc(dnd_filename, c);
unlink(dnd_filename); unlink(dnd_filename);
dnd_filename[0] = NULL; dnd_filename[0] = '\0';
break; break;
default: default:
return; return;
@ -257,7 +257,7 @@ handle_drop_cb(
if (validate_dropped_appt(dnd_filename, c) == False) { if (validate_dropped_appt(dnd_filename, c) == False) {
unlink(dnd_filename); unlink(dnd_filename);
dnd_filename[0] = NULL; dnd_filename[0] = '\0';
transfer_info->status = DtDND_FAILURE; transfer_info->status = DtDND_FAILURE;
} }
#ifdef NOT #ifdef NOT
@ -547,7 +547,7 @@ get_appt_struct(DragContext *context) {
XtFree(ident); XtFree(ident);
XtFree(text); XtFree(text);
XtFree(title); XtFree(title);
return(NULL); return(0);
} }
@ -577,7 +577,7 @@ get_appt_struct(DragContext *context) {
XtFree(ident); XtFree(ident);
XtFree(title); XtFree(title);
XtFree((XtPointer)item_list); XtFree((XtPointer)item_list);
return(NULL); return(0);
} }
return entry; return entry;
@ -630,11 +630,11 @@ GetIcon(Calendar *calendar)
Editor *e = (Editor *) calendar->editor; Editor *e = (Editor *) calendar->editor;
GEditor *ge = (GEditor *) calendar->geditor; GEditor *ge = (GEditor *) calendar->geditor;
if (e->drag_bitmap == NULL) { if (e->drag_bitmap == 0) {
e->drag_bitmap = XCreateBitmapFromData(display, e->drag_bitmap = XCreateBitmapFromData(display,
window, (char *) drag_xbm_bits, window, (char *) drag_xbm_bits,
drag_xbm_width, drag_xbm_height); 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")); printf("%s", catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n"));
return; return;
@ -642,11 +642,11 @@ GetIcon(Calendar *calendar)
else else
ge->drag_bitmap = e->drag_bitmap; ge->drag_bitmap = e->drag_bitmap;
} }
if (e->drag_mask == NULL) { if (e->drag_mask == 0) {
e->drag_mask = XCreateBitmapFromData(display, e->drag_mask = XCreateBitmapFromData(display,
window, (char *) drag_mask_xbm_bits, window, (char *) drag_mask_xbm_bits,
drag_mask_xbm_width, drag_mask_xbm_height); 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")); printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
return; return;
} }

View file

@ -116,8 +116,8 @@ dssw_set_start_hour(Widget w, XtPointer client_data, XtPointer cbs) {
XtVaGetValues(w, XmNuserData, &user_data, NULL); XtVaGetValues(w, XmNuserData, &user_data, NULL);
if (user_data == NO_TIME) { if (user_data == NO_TIME) {
sprintf(dssw->start_val.val, "\0"); dssw->start_val.val[0] = '\0';
sprintf(dssw->stop_val.val, "\0"); dssw->stop_val.val[0] = '\0';
dssw->start_val.block = dssw->stop_val.block = TIME_AM; dssw->start_val.block = dssw->stop_val.block = TIME_AM;
} else if (user_data == ALL_DAY) { } else if (user_data == ALL_DAY) {
if (dt == HOUR12) { if (dt == HOUR12) {
@ -172,7 +172,7 @@ dssw_set_stop_hour(Widget w, XtPointer client_data, XtPointer cbs) {
XtVaGetValues(w, XmNuserData, &user_data, NULL); XtVaGetValues(w, XmNuserData, &user_data, NULL);
if (user_data == NO_TIME) { if (user_data == NO_TIME) {
sprintf(dssw->stop_val.val, "\0"); dssw->stop_val.val[0] = '\0';
dssw->stop_val.block = TIME_AM; dssw->stop_val.block = TIME_AM;
} else { } else {
hrs = user_data / hrsec; hrs = user_data / hrsec;
@ -693,7 +693,7 @@ dssw_form_to_todo(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t)
* Todo does not have end time. So to distinguish between this * Todo does not have end time. So to distinguish between this
* and the editor, zero this out. * and the editor, zero this out.
*/ */
sprintf(dssw->stop_val.val, "\0"); dssw->stop_val.val[0] = '\0';
if (blank_buf(dssw->date_val)) { if (blank_buf(dssw->date_val)) {
editor_err_msg(dssw->parent, name, MISSING_DATE, editor_err_msg(dssw->parent, name, MISSING_DATE,
pu->xm_error_pixmap); pu->xm_error_pixmap);
@ -833,7 +833,7 @@ dssw_attrs_to_form(DSSW *dssw, Dtcm_appointment *appt) {
minute(end_tick)); minute(end_tick));
} else { } else {
/* no end time */ /* no end time */
sprintf(dssw->stop_val.val, "\0"); dssw->stop_val.val[0] = '\0';
dssw->stop_val.block = TIME_AM; dssw->stop_val.block = TIME_AM;
} }
} }
@ -842,7 +842,7 @@ dssw_attrs_to_form(DSSW *dssw, Dtcm_appointment *appt) {
if (what) { if (what) {
strncpy(dssw->what_val, what, WHAT_LEN - 1); 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); set_dssw_vals(dssw, tick);

View file

@ -244,22 +244,22 @@ GetIcon(DTCM_editor *de)
Window window = XtWindow(calendar->frame); Window window = XtWindow(calendar->frame);
unsigned char *bitmapData, *bitmapMask; unsigned char *bitmapData, *bitmapMask;
if (de->drag_bitmap == NULL) { if (de->drag_bitmap == 0) {
de->drag_bitmap = XCreateBitmapFromData(display, de->drag_bitmap = XCreateBitmapFromData(display,
window, (char *) drag_xbm_bits, window, (char *) drag_xbm_bits,
drag_xbm_width, drag_xbm_height); 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; return;
} }
} }
if (de->drag_mask == NULL) { if (de->drag_mask == 0) {
de->drag_mask = XCreateBitmapFromData(display, de->drag_mask = XCreateBitmapFromData(display,
window, (char *) drag_mask_xbm_bits, window, (char *) drag_mask_xbm_bits,
drag_mask_xbm_width, drag_mask_xbm_height); drag_mask_xbm_width, drag_mask_xbm_height);
if (de->drag_mask == NULL) { if (de->drag_mask == 0) {
printf(catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n")); printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
return; return;
} }
} }
@ -394,7 +394,7 @@ StandaloneApptDragStart(
NULL) NULL)
== 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"));
} }
} }

View file

@ -1210,7 +1210,7 @@ build_editor_list(Editor *e, Tick date, Glance glance,
} }
setup_range(&range_attr, &ops, &range_count, start, stop, 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); 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, backend_err_msg(e->frame, e->cal->view->current_calendar, status,
@ -1409,7 +1409,7 @@ trim_end_date_from_rule(char *rule, char *newrule)
if (ptr = strchr(rule, 'Z')) { if (ptr = strchr(rule, 'Z')) {
while (*ptr != ' ') while (*ptr != ' ')
ptr--; ptr--;
*ptr = NULL; *ptr = '\0';
} }
strcpy(newrule, rule); strcpy(newrule, rule);

View file

@ -587,7 +587,7 @@ XmPushButtonCallbackStruct *cbs;
astr = XmTextGetString(f->apptstr); 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.")); sprintf(message, "%s", catgets(c->DT_catd, 1, 290, "Specify Appt String to Match."));
set_message(f->find_message, message); set_message(f->find_message, message);
return; return;
@ -666,7 +666,7 @@ XmPushButtonCallbackStruct *cbs;
_DtTurnOnHourGlass(f->frame); _DtTurnOnHourGlass(f->frame);
for (; stop <= end_of_time;) { for (; stop <= end_of_time;) {
setup_range(&range_attrs, &ops, &range_count, start, stop, 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); stat = csa_list_entries(c->cal_handle, range_count, range_attrs, ops, &num_entries, &entries, NULL);
if (stat != CSA_SUCCESS) { if (stat != CSA_SUCCESS) {
@ -684,7 +684,7 @@ XmPushButtonCallbackStruct *cbs;
return; 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]), if (strncasecmp(astr, &(appt->what->value->item.string_value[j]),
comparison_length) == 0) { comparison_length) == 0) {
new_tick = (Tick_list *) ckalloc(sizeof(Tick_list)); new_tick = (Tick_list *) ckalloc(sizeof(Tick_list));

View file

@ -275,12 +275,12 @@ load_app_font(
* version available. * version available.
*/ */
if (!strcmp(cal->app_data->app_font_family, "application")) { 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, cal->app_data->app_font_family,
(weight == BOLD)?"bold":"medium", (weight == BOLD)?"bold":"medium",
pixel_size); pixel_size);
} else { } 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, cal->app_data->app_font_family,
(weight == BOLD)?"bold":"medium", (weight == BOLD)?"bold":"medium",
pixel_size); pixel_size);

View file

@ -85,7 +85,7 @@ format_date(Tick t, OrderingType order, char *buf, int day_and_date,
struct tm *tm; struct tm *tm;
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
buf[0]=NULL; buf[0] = '\0';
tm = _XLocaltime(&t, localtime_buf); tm = _XLocaltime(&t, localtime_buf);
m = tm->tm_mon+1; m = tm->tm_mon+1;
d = tm->tm_mday; d = tm->tm_mday;
@ -157,7 +157,7 @@ format_date3(Tick t, OrderingType order, SeparatorType sep, char *buf)
char *str = (char *) separator_str(sep); char *str = (char *) separator_str(sep);
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
buf[0]=NULL; buf[0] = '\0';
tm = _XLocaltime(&t, localtime_buf); tm = _XLocaltime(&t, localtime_buf);
m = tm->tm_mon+1; m = tm->tm_mon+1;
@ -194,7 +194,7 @@ format_line(Tick tick,
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
if (buf==NULL) return pad; if (buf==NULL) return pad;
buf[0]=NULL; buf[0] = '\0';
tm = _XLocaltime(&tick, localtime_buf); tm = _XLocaltime(&tick, localtime_buf);
hr = tm->tm_hour; hr = tm->tm_hour;
mn = tm->tm_min; mn = tm->tm_min;
@ -227,16 +227,16 @@ format_line(Tick tick,
width, so I have to line it up myself.. */ width, so I have to line it up myself.. */
if (display == HOUR12) { if (display == HOUR12) {
if (hr > 9) if (hr > 9)
(char *)sprintf(buf, "%2d:%.2d%s ", sprintf(buf, "%2d:%.2d%s ",
hr, mn, am ? "a" : "p"); hr, mn, am ? "a" : "p");
else { else {
(char *)sprintf(buf, "%d:%.2d%s ", sprintf(buf, "%d:%.2d%s ",
hr, mn, am ? "a" : "p"); hr, mn, am ? "a" : "p");
pad = TRUE; pad = TRUE;
} }
} }
else else
(char *)sprintf(buf, "%02d%02d ", hr, mn); sprintf(buf, "%02d%02d ", hr, mn);
} }
} }
if (what) if (what)
@ -262,7 +262,7 @@ format_maxchars(Dtcm_appointment *appt, char *buf1, int maxchars,
if (appt->end_time) if (appt->end_time)
_csa_iso8601_to_tick(appt->end_time->value->item.string_value, _csa_iso8601_to_tick(appt->end_time->value->item.string_value,
&end_tick); &end_tick);
*buf1 = NULL; *buf1 = '\0';
if (appt == NULL || appt->what->value->item.string_value == NULL) return; if (appt == NULL || appt->what->value->item.string_value == NULL) return;
tm = _XLocaltime(&tick, localtime_buf); tm = _XLocaltime(&tick, localtime_buf);
hour1 = tm->tm_hour; hour1 = tm->tm_hour;
@ -336,7 +336,7 @@ format_line2(Dtcm_appointment *appt, char *buf1, char *buf2,
* Extract an appointment and format it into 2 lines of no more * Extract an appointment and format it into 2 lines of no more
* then maxchars * then maxchars
*/ */
*buf1 = *buf2 = NULL; *buf1 = *buf2 = '\0';
if (appt == NULL || appt->what->value->item.string_value == NULL) return; if (appt == NULL || appt->what->value->item.string_value == NULL) return;
tm = _XLocaltime(&tick, localtime_buf); tm = _XLocaltime(&tick, localtime_buf);
hour1 = tm->tm_hour; hour1 = tm->tm_hour;
@ -382,7 +382,7 @@ format_line2(Dtcm_appointment *appt, char *buf1, char *buf2,
if (lines == NULL || lines->s == NULL || if (lines == NULL || lines->s == NULL ||
(cm_strlen(lines->s) == 1 && lines->s[0] == ' ')) (cm_strlen(lines->s) == 1 && lines->s[0] == ' '))
buf2[0] = NULL; buf2[0] = '\0';
else else
sprintf(buf2, " %s", lines->s); sprintf(buf2, " %s", lines->s);
destroy_lines(lines); destroy_lines(lines);

View file

@ -258,7 +258,7 @@ goto_date(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs)
g = (Goto*)c->goTo; g = (Goto*)c->goTo;
date = XmTextGetString(g->datetext); 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")); sprintf(message, "%s", catgets(c->DT_catd, 1, 297, "Please type in a date"));
set_message(g->goto_message, message); set_message(g->goto_message, message);
return; return;

View file

@ -629,7 +629,7 @@ gr_create_stipple(new_XContext *xc, unsigned char *data, int datawidth, int data
if ((*stipple = XCreateBitmapFromData(xc->display, if ((*stipple = XCreateBitmapFromData(xc->display,
xc->xid, xc->xid,
/* RootWindow(xc->display, DefaultScreen(xc->display)), */ /* RootWindow(xc->display, DefaultScreen(xc->display)), */
(char *)data, datawidth, dataheight)) == NULL) { (char *)data, datawidth, dataheight)) == 0) {
ok = False; ok = False;
} }
else { else {

View file

@ -315,7 +315,7 @@ get_mail_address_list(Calendar *c) {
} }
address = calloc(address_len+1, 1); address = calloc(address_len+1, 1);
memset(address, NULL, address_len); memset(address, 0, address_len);
for (i = 0; i < pos_cnt; i++) { for (i = 0; i < pos_cnt; i++) {
ad = (Access_data *)CmDataListGetData(ge->access_data, ad = (Access_data *)CmDataListGetData(ge->access_data,
@ -1803,7 +1803,7 @@ add_all_gappt(GEditor *ge) {
continue; continue;
setup_range(&range_attr, &ops, &range_count, start, stop, 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, csa_list_entries(step->cal_handle, range_count, range_attr,
ops, &entry_count, &entry_list, NULL); ops, &entry_count, &entry_list, NULL);
free_range(&range_attr, &ops, range_count); free_range(&range_attr, &ops, range_count);

View file

@ -120,7 +120,7 @@ void show_main_help(Widget w, XtPointer clientData, XtPointer cbs)
ac = 0; ac = 0;
XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++; XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
switch ((int)clientData) { switch ((intptr_t)clientData) {
case HELP_OVERVIEW: case HELP_OVERVIEW:
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++; XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++; XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
@ -149,7 +149,7 @@ void show_main_help(Widget w, XtPointer clientData, XtPointer cbs)
while (!XtIsSubclass(w, applicationShellWidgetClass)) while (!XtIsSubclass(w, applicationShellWidgetClass))
w = XtParent(w); w = XtParent(w);
status = DtHelpReturnSelectedWidgetId(w, NULL, &selWidget); status = DtHelpReturnSelectedWidgetId(w, 0, &selWidget);
switch ((int)status) switch ((int)status)
{ {
case DtHELP_SELECT_ERROR: case DtHELP_SELECT_ERROR:

View file

@ -160,8 +160,8 @@ load_icons(
/* See if the resolution size we have chosen is acceptable by the WM */ /* See if the resolution size we have chosen is acceptable by the WM */
if (!(size = wm_icon_preference(XtDisplay(c->frame), screen, size))) { if (!(size = wm_icon_preference(XtDisplay(c->frame), screen, size))) {
c->icon->icon = NULL; c->icon->icon = 0;
c->icon_inverted->icon = NULL; c->icon_inverted->icon = 0;
return (FALSE); return (FALSE);
} }
@ -205,22 +205,22 @@ load_icon(
if (!(icon_filename = XmGetIconFileName(screen, NULL, icon_name, if (!(icon_filename = XmGetIconFileName(screen, NULL, icon_name,
NULL, size))) { NULL, size))) {
icon->icon = NULL; icon->icon = 0;
return (FALSE); return (FALSE);
} }
if ((icon->icon = XmGetPixmap(screen, icon_filename, fg, bg)) == if ((icon->icon = XmGetPixmap(screen, icon_filename, fg, bg)) ==
XmUNSPECIFIED_PIXMAP) { XmUNSPECIFIED_PIXMAP) {
free(icon_filename); free(icon_filename);
icon->icon = NULL; icon->icon = 0;
return (FALSE); return (FALSE);
} }
if ((icon->icon_mask = _DtGetMask(screen, icon_filename)) == if ((icon->icon_mask = _DtGetMask(screen, icon_filename)) ==
XmUNSPECIFIED_PIXMAP) { XmUNSPECIFIED_PIXMAP) {
free(icon_filename); free(icon_filename);
icon->icon = NULL; icon->icon = 0;
icon->icon_mask = NULL; icon->icon_mask = 0;
return (FALSE); return (FALSE);
} }
@ -247,12 +247,12 @@ free_icon(
if (icon->icon) if (icon->icon)
XmDestroyPixmap(XtScreen(c->frame), icon->icon); XmDestroyPixmap(XtScreen(c->frame), icon->icon);
icon->icon = NULL; icon->icon = 0;
if (icon->icon_mask) if (icon->icon_mask)
XmDestroyPixmap(XtScreen(c->frame), icon->icon_mask); XmDestroyPixmap(XtScreen(c->frame), icon->icon_mask);
icon->icon_mask = NULL; icon->icon_mask = 0;
} }
static void static void

View file

@ -583,7 +583,7 @@ create_all_pixmaps(Props_pu *p, Widget w)
if ((p->drag_icon_xbm = XmGetPixmap(s, "DtCMdnd.m.pm", fg, bg)) == if ((p->drag_icon_xbm = XmGetPixmap(s, "DtCMdnd.m.pm", fg, bg)) ==
XmUNSPECIFIED_PIXMAP) { XmUNSPECIFIED_PIXMAP) {
p->drag_icon_xbm = NULL; p->drag_icon_xbm = 0;
} }
} }
@ -663,10 +663,10 @@ cm_mbchar(char *str) {
static void static void
response(Widget w, XtPointer client_data, XtPointer cbs) { response(Widget w, XtPointer client_data, XtPointer cbs) {
XtPointer userData = (XtPointer)0; XtPointer userData = (XtPointer)0;
int *answerP = (int *)client_data; int *answerP = (int *) (intptr_t)client_data;
XtVaGetValues(w, XmNuserData, &userData, NULL); XtVaGetValues(w, XmNuserData, &userData, NULL);
*answerP = (int)userData; *answerP = (intptr_t)userData;
} }
/* /*

View file

@ -209,14 +209,14 @@ paint_day_entries(
w - pad_width, w - pad_width,
buf, pf); buf, pf);
if (cm_strlen(buf) > maxchars) if (cm_strlen(buf) > maxchars)
buf[maxchars] = NULL; buf[maxchars] = '\0';
(void)gr_text(xc, x + pad_width, (void)gr_text(xc, x + pad_width,
y, pf, buf, rect); y, pf, buf, rect);
} else { } else {
maxchars = gr_nchars(w, buf, maxchars = gr_nchars(w, buf,
pf); pf);
if (cm_strlen(buf) > maxchars) if (cm_strlen(buf) > maxchars)
buf[maxchars] = NULL; buf[maxchars] = '\0';
(void)gr_text(xc, x, y, pf, (void)gr_text(xc, x, y, pf,
buf, rect); buf, rect);
} }
@ -306,7 +306,7 @@ paint_month(Calendar *c, Tick key, XRectangle *rect)
start = (time_t) lowerbound(day); start = (time_t) lowerbound(day);
stop = (time_t) last_dom(day); stop = (time_t) last_dom(day);
setup_range(&range_attrs, &ops, &j, start, stop, CSA_TYPE_EVENT, 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); csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL);
free_range(&range_attrs, &ops, j); free_range(&range_attrs, &ops, j);
@ -571,7 +571,7 @@ get_time_str (Dtcm_appointment *appt, char *buf)
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &start_tick); _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)) if (appt==NULL || !showtime_set(appt) || magic_time(start_tick))
return; return;
@ -724,7 +724,7 @@ count_month_pages(Calendar *c, Tick start_date, int lines_per_box)
start = (time_t) lowerbound (day); start = (time_t) lowerbound (day);
stop = (time_t) next_ndays(day, 1) - 1; stop = (time_t) next_ndays(day, 1) - 1;
setup_range(&range_attrs, &ops, &j, start, stop, setup_range(&range_attrs, &ops, &j, start, stop,
CSA_TYPE_EVENT, NULL, B_FALSE, CSA_TYPE_EVENT, 0, B_FALSE,
c->general->version); c->general->version);
csa_list_entries(c->cal_handle, j, range_attrs, ops, csa_list_entries(c->cal_handle, j, range_attrs, ops,
&a_total, &list, NULL); &a_total, &list, NULL);
@ -804,7 +804,7 @@ print_month ( Calendar *c,
lo_hour = (time_t)lowerbound (day); lo_hour = (time_t)lowerbound (day);
hi_hour = (time_t) next_ndays(day, 1) - 1; hi_hour = (time_t) next_ndays(day, 1) - 1;
setup_range(&range_attrs, &ops, &j, lo_hour, hi_hour, 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, csa_list_entries(c->cal_handle, j, range_attrs,
ops, &a_total, &list, NULL); ops, &a_total, &list, NULL);
free_range(&range_attrs, &ops, j); free_range(&range_attrs, &ops, j);
@ -924,7 +924,7 @@ static void
quick_button_cb(Widget widget, XtPointer client, XtPointer call) quick_button_cb(Widget widget, XtPointer client, XtPointer call)
{ {
Calendar *c = calendar; Calendar *c = calendar;
int dom = (int) client; int dom = (int) (intptr_t) client;
c->view->olddate = c->view->date; c->view->olddate = c->view->date;
c->view->date = next_ndays(first_dom(c->view->date), dom); c->view->date = next_ndays(first_dom(c->view->date), dom);
@ -1059,7 +1059,7 @@ allocator(Calendar *c)
XmCreatePushButton(c->canvas, buf, NULL, 0); XmCreatePushButton(c->canvas, buf, NULL, 0);
XtVaSetValues(m->hot_button[n], XmNlabelString, str, NULL); XtVaSetValues(m->hot_button[n], XmNlabelString, str, NULL);
XtAddCallback(m->hot_button[n],XmNactivateCallback, XtAddCallback(m->hot_button[n],XmNactivateCallback,
quick_button_cb, (XtPointer)n); quick_button_cb, (XtPointer) (intptr_t) n);
XmStringFree(str); XmStringFree(str);
} }
} }

View file

@ -29,6 +29,7 @@
*/ */
#include <EUSCompat.h> #include <EUSCompat.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
@ -984,7 +985,7 @@ create_print_dialog(Calendar *c)
*/ */
pd->report_type = PR_DAY_VIEW; pd->report_type = PR_DAY_VIEW;
pd->report_type_option = XmVaCreateSimpleOptionMenu(pd->form, pd->report_type_option = XmVaCreateSimpleOptionMenu(pd->form,
"TypeOptionMenu", view, NULL, "TypeOptionMenu", view, 0,
pd->report_type, report_option_cb, pd->report_type, report_option_cb,
XmVaPUSHBUTTON, day_view, NULL, NULL, NULL, XmVaPUSHBUTTON, day_view, NULL, NULL, NULL,
XmVaPUSHBUTTON, week_view, NULL, NULL, NULL, XmVaPUSHBUTTON, week_view, NULL, NULL, NULL,
@ -1489,7 +1490,7 @@ print_report(Calendar *c)
static void static void
report_option_cb(Widget w, XtPointer client_data, XtPointer call_data) 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; Calendar *c = calendar;
pd_set_report_managed(c, choice); pd_set_report_managed(c, choice);

View file

@ -2404,7 +2404,7 @@ p_make_props_pu(Calendar *c) {
p->category_menu = widgets[0] = p->category_menu = widgets[0] =
XmVaCreateSimpleOptionMenu(p->base_form_mgr, 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[EDITOR_PANE], NULL, NULL, NULL,
XmVaPUSHBUTTON, Pane_XmStrs[DISPLAY_PANE], NULL, NULL, NULL, XmVaPUSHBUTTON, Pane_XmStrs[DISPLAY_PANE], NULL, NULL, NULL,
XmVaPUSHBUTTON, Pane_XmStrs[GROUP_ACCESS_PANE], NULL, NULL,NULL, XmVaPUSHBUTTON, Pane_XmStrs[GROUP_ACCESS_PANE], NULL, NULL,NULL,

View file

@ -176,7 +176,7 @@ CMSaveSessionCB (
if (save_session) { if (save_session) {
memcpy(command + command_len, "-session", 8); memcpy(command + command_len, "-session", 8);
command_len += 8; command_len += 8;
command[command_len] = NULL; command[command_len] = '\0';
command_len++; command_len++;
memcpy(command + command_len, name, strlen(name)); memcpy(command + command_len, name, strlen(name));
command_len += strlen(name); command_len += strlen(name);
@ -234,7 +234,7 @@ GetSessionInfo(
if (path) XtFree(path); if (path) XtFree(path);
xrm_name[1] = NULL; xrm_name[1] = '\0';
/* get default view */ /* get default view */
xrm_name[0] = XrmStringToQuark ("defaultView"); xrm_name[0] = XrmStringToQuark ("defaultView");

View file

@ -54,6 +54,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <LocaleXlate.h> #include <LocaleXlate.h>
#include <RFCMIME.h> #include <RFCMIME.h>
@ -372,7 +373,10 @@ deliver(char ** addrs, char * msg)
} }
argv[cp + 1] = NULL; 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(); c_pid = fork();
if (c_pid < 0) { if (c_pid < 0) {
@ -386,7 +390,10 @@ deliver(char ** addrs, char * msg)
_exit(1); /* This had better never happen! */ _exit(1); /* This had better never happen! */
} }
else { /* The parent. */ 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[0]);
close(fd[1]); close(fd[1]);

View file

@ -2224,7 +2224,7 @@ build_todo_view(ToDo *t, Glance glance, Boolean redisplay) {
XmNvalueChangedCallback, t_view_change_proc, t); XmNvalueChangedCallback, t_view_change_proc, t);
step->next = NULL; step->next = NULL;
step->appt = NULL; step->appt = 0;
if (last) { if (last) {
XtVaSetValues(step->view_item_number, XtVaSetValues(step->view_item_number,
XmNtopAttachment, XmATTACH_WIDGET, XmNtopAttachment, XmATTACH_WIDGET,
@ -2241,7 +2241,7 @@ build_todo_view(ToDo *t, Glance glance, Boolean redisplay) {
XtManageChild(step->view_item_number); XtManageChild(step->view_item_number);
XtManageChild(step->view_item_toggle); XtManageChild(step->view_item_toggle);
} }
if (step->appt != NULL) if (step->appt != 0)
csa_free((CSA_buffer) step->appt); csa_free((CSA_buffer) step->appt);
step->appt = entry_list[cnt - 1]; step->appt = entry_list[cnt - 1];
step->modified = False; step->modified = False;
@ -2294,7 +2294,7 @@ build_todo_view(ToDo *t, Glance glance, Boolean redisplay) {
** possibly filled with old stuff -- unmanage these widgets. ** possibly filled with old stuff -- unmanage these widgets.
*/ */
while (step) { while (step) {
if (step->appt != NULL) if (step->appt != 0)
csa_free((CSA_buffer) step->appt); csa_free((CSA_buffer) step->appt);
XtUnmanageChild(step->view_item_number); XtUnmanageChild(step->view_item_number);
XtUnmanageChild(step->view_item_toggle); XtUnmanageChild(step->view_item_toggle);

View file

@ -157,7 +157,7 @@ count_week_pages (Calendar *c, int lines_per_page, Tick start_date)
start = (time_t) lowerbound (start_date); start = (time_t) lowerbound (start_date);
stop = (time_t) next_ndays(start_date, 1) - 1; stop = (time_t) next_ndays(start_date, 1) - 1;
setup_range(&range_attrs, &ops, &j, start, stop, 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); csa_list_entries(c->cal_handle, j, range_attrs, ops, &a_total, &list, NULL);
free_range(&range_attrs, &ops, j); free_range(&range_attrs, &ops, j);
@ -250,7 +250,7 @@ print_week (Calendar *c,
start = (time_t) lowerbound (start_date); start = (time_t) lowerbound (start_date);
stop = (time_t) next_ndays(start_date, 1) - 1; stop = (time_t) next_ndays(start_date, 1) - 1;
setup_range(&range_attrs, &ops, &j, start, stop, 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, csa_list_entries(c->cal_handle, j, range_attrs,
ops, &a_total, &list, NULL); ops, &a_total, &list, NULL);
free_range(&range_attrs, &ops, j); free_range(&range_attrs, &ops, j);
@ -459,7 +459,7 @@ allocator(Calendar *c)
w->hot_button[n] = w->hot_button[n] =
XmCreatePushButton(c->canvas, "week2day", args, 1); XmCreatePushButton(c->canvas, "week2day", args, 1);
XtAddCallback(w->hot_button[n],XmNactivateCallback, 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) */ /* selection info (and init its permanent attributes) */
@ -864,7 +864,7 @@ draw_week(Calendar *c, XRectangle *rect, Boundary boundary)
if (c->paint_cache == NULL) { if (c->paint_cache == NULL) {
setup_range(&range_attrs, &ops, &i, start, stop, CSA_TYPE_EVENT, 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, csa_list_entries(c->cal_handle, i, range_attrs, ops,
&a_total, &list, NULL); &a_total, &list, NULL);
free_range(&range_attrs, &ops, i); free_range(&range_attrs, &ops, i);
@ -1031,7 +1031,7 @@ format_entry(Paint_cache *cache_entry, char *buf1, char *buf2,
* Extract an appointment and format it into 2 lines of no more * Extract an appointment and format it into 2 lines of no more
* then maxchars * then maxchars
*/ */
*buf1 = *buf2 = NULL; *buf1 = *buf2 = '\0';
if (cache_entry == NULL || cache_entry->summary == NULL) return; if (cache_entry == NULL || cache_entry->summary == NULL) return;
tm = _XLocaltime(&tick, localtime_buf); tm = _XLocaltime(&tick, localtime_buf);
hour1 = tm->tm_hour; hour1 = tm->tm_hour;
@ -1076,7 +1076,7 @@ format_entry(Paint_cache *cache_entry, char *buf1, char *buf2,
if (lines == NULL || lines->s == NULL || if (lines == NULL || lines->s == NULL ||
(cm_strlen(lines->s) == 1 && lines->s[0] == ' ')) (cm_strlen(lines->s) == 1 && lines->s[0] == ' '))
buf2[0] = NULL; buf2[0] = '\0';
else else
sprintf(buf2, " %s", lines->s); sprintf(buf2, " %s", lines->s);
destroy_lines(lines); destroy_lines(lines);
@ -1100,15 +1100,15 @@ paint_entry(Calendar *c, int x, int y, int maxchars, Paint_cache *cache_entry, X
if (maxchars >= 40) /* maxed out possible=40 */ if (maxchars >= 40) /* maxed out possible=40 */
maxchars = 40; maxchars = 40;
buf1[0]=NULL; buf2[0]=NULL; buf1[0] = '\0'; buf2[0] = '\0';
format_entry(cache_entry, buf1, buf2, dt); format_entry(cache_entry, buf1, buf2, dt);
tick = cache_entry->start_time; 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); 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); gr_text(xc, x, y, c->fonts->boldfont, buf1, rect);
nlines++; nlines++;
CalFontExtents(c->fonts->boldfont, &fontextents); CalFontExtents(c->fonts->boldfont, &fontextents);
@ -1117,7 +1117,7 @@ paint_entry(Calendar *c, int x, int y, int maxchars, Paint_cache *cache_entry, X
if (buf2[0] != '\0') { if (buf2[0] != '\0') {
maxchars = gr_nchars(w->day_width - 5, buf2, maxchars = gr_nchars(w->day_width - 5, buf2,
c->fonts->viewfont); 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); gr_text(xc, x, y, c->fonts->viewfont, buf2, rect);
nlines++; nlines++;
} }
@ -1391,7 +1391,7 @@ quick_button_cb(Widget widget, XtPointer client, XtPointer call)
{ {
Calendar *c = calendar; Calendar *c = calendar;
Week *w = (Week *)c->view->week_info; Week *w = (Week *)c->view->week_info;
int dow = (int) client; int dow = (int) (intptr_t) client;
char buf[BUFSIZ]; char buf[BUFSIZ];
if (c->view->date != get_bot()) { if (c->view->date != get_bot()) {

View file

@ -2887,7 +2887,7 @@ x_print_multi_appts(void *gInfoP,
/* HH:MM xm - HH:MM xm format */ /* HH:MM xm - HH:MM xm format */
format_line2(appt, buf1, buf2, dt); format_line2(appt, buf1, buf2, dt);
indented = (*buf1 != NULL); indented = (*buf1 != '\0');
indentAmt = (view == dayGlance) ? 0 : 1; indentAmt = (view == dayGlance) ? 0 : 1;
if (indented) if (indented)
indentAmt += 2; indentAmt += 2;
@ -2992,7 +2992,7 @@ x_print_list_range(Calendar *c, CSA_sint32 appt_type, int item_data,
"Appt List Beginning: %s"), buf2); "Appt List Beginning: %s"), buf2);
setup_range(&range_attrs, &ops, &i, start, end, appt_type, 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, stat = csa_list_entries(c->cal_handle, i, range_attrs,
ops, &a_total, &list, NULL); ops, &a_total, &list, NULL);
if (stat != CSA_SUCCESS) { if (stat != CSA_SUCCESS) {
@ -3939,7 +3939,7 @@ x_print_month_appts(void *gInfoP, CSA_entry_handle *list,
{ {
get_time_str(appt, buf1); get_time_str(appt, buf1);
indented = (*buf1 != NULL); indented = (*buf1 != '\0');
lines = text_to_lines(appt->what->value->item.string_value, 1); lines = text_to_lines(appt->what->value->item.string_value, 1);
line_counter++; line_counter++;

View file

@ -196,13 +196,13 @@ mini_err_msg(
char *buf, *ptr; char *buf, *ptr;
if (type == TTY_Insert) if (type == TTY_Insert)
fprintf(stderr, "%s %s", fprintf(stderr, "%s",
catgets(catd, 1, 1042, "Insert Access Denied: ")); catgets(catd, 1, 1042, "Insert Access Denied: "));
else if (type == TTY_Delete) else if (type == TTY_Delete)
fprintf(stderr, "%s %s", fprintf(stderr, "%s",
catgets(catd, 1, 1043, "Delete Access Denied: ")); catgets(catd, 1, 1043, "Delete Access Denied: "));
else else
fprintf(stderr, "%s %s", fprintf(stderr, "%s",
catgets(catd, 1, 1044, "Lookup Access Denied: ")); catgets(catd, 1, 1044, "Lookup Access Denied: "));
if (appt_what && appt_what[0] != '\0') { if (appt_what && appt_what[0] != '\0') {
@ -398,7 +398,7 @@ scrub_attr_list(Dtcm_appointment *appt) {
for (i = 0; i < appt->count; i++) { for (i = 0; i < appt->count; i++) {
if (appt->attrs[i].value->type == CSA_VALUE_REMINDER) { if (appt->attrs[i].value->type == CSA_VALUE_REMINDER) {
if ((appt->attrs[i].value->item.reminder_value->lead_time == NULL) || 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); free(appt->attrs[i].name);
appt->attrs[i].name = NULL; appt->attrs[i].name = NULL;
} }
@ -613,7 +613,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date,
start = lowerbound(tick - (day * daysec)); start = lowerbound(tick - (day * daysec));
stop = next_ndays(start, span) - 1; stop = next_ndays(start, span) - 1;
setup_range(&range_attrs, &ops, &i, start, stop, CSA_TYPE_EVENT, 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); status = csa_list_entries(target, i, range_attrs, ops, &a_total, list, NULL);
free_range(&range_attrs, &ops, i); free_range(&range_attrs, &ops, i);
@ -653,7 +653,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date,
if (appt->end_time) if (appt->end_time)
format_time(end_tick, dt, end_buf); format_time(end_tick, dt, end_buf);
else else
*end_buf = NULL; *end_buf = '\0';
sprintf(buf, "%s%c%7s ", start_buf, sprintf(buf, "%s%c%7s ", start_buf,
(*end_buf ? '-' : ' '), end_buf); (*end_buf ? '-' : ' '), end_buf);
} }
@ -964,7 +964,7 @@ build_new_attrval(CSA_attribute *attrval, char *name, char *tag, char *value)
if (!strcmp(tag, "caluser")) { if (!strcmp(tag, "caluser")) {
vptr->type = CSA_VALUE_CALENDAR_USER; vptr->type = CSA_VALUE_CALENDAR_USER;
s_ptr = strchr(value, ':'); 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 = calloc(sizeof(CSA_calendar_user), 1);
vptr->item.calendar_user_value->user_name = cm_strdup(s_ptr + 1); vptr->item.calendar_user_value->user_name = cm_strdup(s_ptr + 1);
vptr->item.calendar_user_value->user_type = atoi(value); vptr->item.calendar_user_value->user_type = atoi(value);
@ -983,7 +983,7 @@ build_new_attrval(CSA_attribute *attrval, char *name, char *tag, char *value)
if (!strcmp(tag, "reminder")) { if (!strcmp(tag, "reminder")) {
vptr->type = CSA_VALUE_REMINDER; vptr->type = CSA_VALUE_REMINDER;
s_ptr = strchr(value, ':'); s_ptr = strchr(value, ':');
*s_ptr = NULL; *s_ptr = '\0';
vptr->item.reminder_value = calloc(sizeof(CSA_reminder), 1); vptr->item.reminder_value = calloc(sizeof(CSA_reminder), 1);
@ -1012,13 +1012,13 @@ build_new_attrval(CSA_attribute *attrval, char *name, char *tag, char *value)
l_ptr = calloc(sizeof(CSA_access_rights), 1); l_ptr = calloc(sizeof(CSA_access_rights), 1);
s_ptr = strchr(b_ptr, ':'); s_ptr = strchr(b_ptr, ':');
*s_ptr = NULL; *s_ptr = '\0';
l_ptr->rights = atoi(b_ptr); l_ptr->rights = atoi(b_ptr);
b_ptr = s_ptr + 1; b_ptr = s_ptr + 1;
if (s_ptr = strchr(b_ptr, '\n')) if (s_ptr = strchr(b_ptr, '\n'))
*s_ptr = NULL; *s_ptr = '\0';
l_ptr->user->user_name = cm_strdup(b_ptr); l_ptr->user->user_name = cm_strdup(b_ptr);
@ -1112,7 +1112,7 @@ read_new_appt(FILE *fp, Dtcm_appointment **appt, Props *p, int version)
strcat(a_value, "\n"); strcat(a_value, "\n");
strcat(a_value, b_ptr); strcat(a_value, b_ptr);
a_value[strlen(a_value) - 1] = NULL; a_value[strlen(a_value) - 1] = '\0';
continue; continue;
} }
@ -1161,7 +1161,7 @@ read_new_appt(FILE *fp, Dtcm_appointment **appt, Props *p, int version)
b_ptr = line; b_ptr = line;
if (c_ptr = strchr(line, ':')) if (c_ptr = strchr(line, ':'))
{ {
*c_ptr = NULL; *c_ptr = '\0';
a_name = cm_strdup(b_ptr); a_name = cm_strdup(b_ptr);
} }
else else
@ -1175,7 +1175,7 @@ read_new_appt(FILE *fp, Dtcm_appointment **appt, Props *p, int version)
if (c_ptr = strchr(b_ptr, ':')) if (c_ptr = strchr(b_ptr, ':'))
{ {
*c_ptr = NULL; *c_ptr = '\0';
a_tag = cm_strdup(b_ptr); a_tag = cm_strdup(b_ptr);
} }
else else
@ -1187,7 +1187,7 @@ read_new_appt(FILE *fp, Dtcm_appointment **appt, Props *p, int version)
if (!*b_ptr) if (!*b_ptr)
break; break;
else else
b_ptr[strlen(b_ptr) - 1] = NULL; b_ptr[strlen(b_ptr) - 1] = '\0';
a_value = cm_strdup(b_ptr); a_value = cm_strdup(b_ptr);
} }
@ -1667,7 +1667,7 @@ cat_indented_string(char **catbuf, char *string)
*b_ptr++ = '\t'; *b_ptr++ = '\t';
p_str++; p_str++;
} }
*b_ptr = NULL; *b_ptr = '\0';
growcat(catbuf, buf); growcat(catbuf, buf);
@ -1683,12 +1683,12 @@ attrs_to_string(CSA_attribute * attrs, int num_attrs)
char tmp_buf[MAXNAMELEN]; char tmp_buf[MAXNAMELEN];
int advance_time; int advance_time;
buffer[0] = NULL; buffer[0] = '\0';
for (i = 0; i < num_attrs; i++) { for (i = 0; i < num_attrs; i++) {
if (!attrs[i].name || (attrs[i].value == NULL)) if (!attrs[i].name || (attrs[i].value == NULL))
continue; continue;
tmp_buf[0] = NULL; tmp_buf[0] = '\0';
sprintf(tmp_buf, "%s:", attrs[i].name); sprintf(tmp_buf, "%s:", attrs[i].name);
switch (attrs[i].value->type) { switch (attrs[i].value->type) {
case CSA_VALUE_SINT32: case CSA_VALUE_SINT32:
@ -1765,7 +1765,7 @@ attrs_to_string(CSA_attribute * attrs, int num_attrs)
a_ptr = attrs[i].value->item.access_list_value; a_ptr = attrs[i].value->item.access_list_value;
while (a_ptr) { while (a_ptr) {
sprintf(tmp_buf, "\t%d:%s\n", 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); growcat(&buffer, tmp_buf);
a_ptr = a_ptr->next; a_ptr = a_ptr->next;
} }
@ -1865,11 +1865,11 @@ parse_attrs_to_string(Dtcm_appointment *appt, Props *p, char *attr_string) {
CSA_uint32 repeat_times; 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"; 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; s_buf[0] = '\0';
e_buf[0] = NULL; e_buf[0] = '\0';
w_buf[0] = NULL; w_buf[0] = '\0';
r_buf[0] = NULL; r_buf[0] = '\0';
f_buf[0] = NULL; f_buf[0] = '\0';
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &tick); _csa_iso8601_to_tick(appt->time->value->item.date_time_value, &tick);
if (appt->end_time) if (appt->end_time)
@ -2144,7 +2144,7 @@ str_to_period(char *ps, CSA_sint32 *repeat_type, int *repeat_nth) {
boolean_t compute_times = B_FALSE; boolean_t compute_times = B_FALSE;
char *ps2, *ptr, *ptr2, *unit; char *ps2, *ptr, *ptr2, *unit;
*repeat_type = NULL; *repeat_type = '\0';
*repeat_nth = 0; *repeat_nth = 0;
if (ps == NULL) if (ps == NULL)
return; return;
@ -2186,7 +2186,7 @@ str_to_period(char *ps, CSA_sint32 *repeat_type, int *repeat_nth) {
ps2 = cm_strdup(unit); ps2 = cm_strdup(unit);
ptr = strchr(ps2, ' '); ptr = strchr(ps2, ' ');
if (ptr != NULL) if (ptr != NULL)
*ptr = NULL; *ptr = '\0';
else else
return; return;
@ -2235,13 +2235,13 @@ periodstr_from_period(CSA_sint32 repeat_type, int repeat_nth) {
sprintf(pstr, "%s", periodstrings[6]); sprintf(pstr, "%s", periodstrings[6]);
break; break;
case CSA_X_DT_REPEAT_EVERY_NDAY: 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; break;
case CSA_X_DT_REPEAT_EVERY_NWEEK: 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; break;
case CSA_X_DT_REPEAT_EVERY_NMONTH: 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; break;
case CSA_X_DT_REPEAT_OTHER: case CSA_X_DT_REPEAT_OTHER:
sprintf(pstr, "%s", periodstrings[10]); sprintf(pstr, "%s", periodstrings[10]);

View file

@ -923,7 +923,7 @@ xytoclock(int x, int y, Tick t)
Tick tick; Tick tick;
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
memset(&timestruct, NULL, sizeof(struct tm)); memset(&timestruct, 0, sizeof(struct tm));
tm = *_XLocaltime(&t, localtime_buf); tm = *_XLocaltime(&t, localtime_buf);
mn = tm.tm_mon + 1; mn = tm.tm_mon + 1;
@ -1094,7 +1094,7 @@ monthdayyear(int m, int d, int y)
struct tm timestruct; struct tm timestruct;
memset(&timestruct, NULL, sizeof(struct tm)); memset(&timestruct, 0, sizeof(struct tm));
timestruct.tm_mon = m - 1; timestruct.tm_mon = m - 1;
timestruct.tm_mday = d; timestruct.tm_mday = d;
timestruct.tm_year = y - 1900; timestruct.tm_year = y - 1900;

View file

@ -146,7 +146,7 @@ cm_def_printer()
} }
#else #else
tmp = (char*)getenv("PRINTER"); tmp = (char*)getenv("PRINTER");
if (tmp != NULL && *tmp != NULL) { if (tmp != NULL && *tmp != '\0') {
printer_name = (char*)malloc(strlen(tmp)+1); printer_name = (char*)malloc(strlen(tmp)+1);
strcpy(printer_name, tmp); strcpy(printer_name, tmp);
} }
@ -187,7 +187,7 @@ cm_strlen(register char *s)
{ {
register int n; register int n;
if (s==NULL) return NULL; if (s==NULL) return 0;
return (strlen(s)); return (strlen(s));
} }
@ -246,7 +246,7 @@ str_to_cr(char *s)
} }
k++; k++;
} }
newstr[k] = NULL; newstr[k] = '\0';
return(newstr); return(newstr);
} }
@ -286,7 +286,7 @@ cr_to_str(char *s)
k++; k++;
} }
} }
newstr[k] = NULL; newstr[k] = '\0';
return(newstr); return(newstr);
} }
@ -504,7 +504,7 @@ get_head(char *str, char sep)
if (ptr == buf) if (ptr == buf)
return(NULL); return(NULL);
else { else {
*ptr = NULL; *ptr = '\0';
return(cm_strdup(buf)); return(cm_strdup(buf));
} }
} }
@ -584,7 +584,10 @@ cm_get_local_domain()
#if defined(sun) || defined(USL) || defined(__uxp__) #if defined(sun) || defined(USL) || defined(__uxp__)
sysinfo(SI_SRPC_DOMAIN, local_domain, DOM_NM_LN); sysinfo(SI_SRPC_DOMAIN, local_domain, DOM_NM_LN);
#else #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__ */ #endif /* sun || USL || __uxp__ */
} }
return(local_domain); return(local_domain);
@ -733,10 +736,10 @@ match_forward(char *str1, char *str2)
get_component(&str2, com2, '.'); get_component(&str2, com2, '.');
if (*com1) { if (*com1) {
if (*com2 == NULL) if (*com2 == '\0')
return (B_TRUE); return (B_TRUE);
} else { } else {
if (*com2 == NULL) if (*com2 == '\0')
return (B_TRUE); return (B_TRUE);
else else
return (B_FALSE); return (B_FALSE);
@ -747,18 +750,18 @@ match_forward(char *str1, char *str2)
/* take care of case: a.b a. */ /* take care of case: a.b a. */
if (strcmp(str2, ".") == 0 if (strcmp(str2, ".") == 0
&& (strcmp(str1, ".") != 0 || *str1 != NULL)) && (strcmp(str1, ".") != 0 || *str1 != '\0'))
return (B_FALSE); return (B_FALSE);
/* skip "." */ /* skip "." */
if (*str1 == '.') { if (*str1 == '.') {
if (*str2 == NULL) if (*str2 == '\0')
return (B_TRUE); return (B_TRUE);
else { else {
str1++; str1++;
str2++; str2++;
} }
} else if (strcmp(str2, ".") == 0 || *str2 == NULL) } else if (strcmp(str2, ".") == 0 || *str2 == '\0')
return (B_TRUE); return (B_TRUE);
else else
return (B_FALSE); return (B_FALSE);
@ -796,10 +799,10 @@ match_backward(char *str1, char *str2)
get_last_component(str2, &ptr2, com2, '.'); get_last_component(str2, &ptr2, com2, '.');
if (*com1) { if (*com1) {
if (*com2 == NULL) if (*com2 == '\0')
return (B_TRUE); return (B_TRUE);
} else { } else {
if (*com2 == NULL) if (*com2 == '\0')
return (B_TRUE); return (B_TRUE);
else else
return (B_FALSE); return (B_FALSE);
@ -1041,9 +1044,9 @@ parse_date(OrderingType order, SeparatorType sep, char *datestr, char *m,
char *tmp_date, *str = separator_str(sep); char *tmp_date, *str = separator_str(sep);
_Xstrtokparams strtok_buf; _Xstrtokparams strtok_buf;
m[0] = NULL; m[0] = '\0';
d[0] = NULL; d[0] = '\0';
y[0] = NULL; y[0] = '\0';
if (datestr == NULL) if (datestr == NULL)
return 0; return 0;
@ -1098,7 +1101,7 @@ extern int
datestr2mdy(char *datestr, OrderingType order, SeparatorType sep, char *buf) { datestr2mdy(char *datestr, OrderingType order, SeparatorType sep, char *buf) {
char m[3], d[3], y[5]; char m[3], d[3], y[5];
buf[0] = NULL; buf[0] = '\0';
if (datestr == NULL) if (datestr == NULL)
return 0; return 0;
@ -1124,7 +1127,7 @@ format_tick(Tick tick, OrderingType order, SeparatorType sep, char *buff) {
struct tm *tm; struct tm *tm;
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
buff[0] = NULL; buff[0] = '\0';
tm = _XLocaltime(&tick, localtime_buf); tm = _XLocaltime(&tick, localtime_buf);
switch (order) { switch (order) {
@ -1150,7 +1153,7 @@ format_time(Tick t, DisplayType dt, char *buffer) {
boolean_t am; boolean_t am;
if (t == 0) { if (t == 0) {
sprintf(buffer, "\0"); buffer[0] = '\0';
} else if (dt == HOUR12) { } else if (dt == HOUR12) {
am = adjust_hour(&hr); am = adjust_hour(&hr);
@ -1234,7 +1237,7 @@ Dtcm_appointment *allocate_appt_struct (Allocation_reason reason, int version, .
*/ */
idx = sizeof(Dtcm_appointment); idx = sizeof(Dtcm_appointment);
appt = (Dtcm_appointment *)ckalloc(idx); appt = (Dtcm_appointment *)ckalloc(idx);
memset(appt, NULL, idx); memset(appt, 0, idx);
appt->reason = reason; appt->reason = reason;
appt->version = version; appt->version = version;
@ -1246,7 +1249,7 @@ Dtcm_appointment *allocate_appt_struct (Allocation_reason reason, int version, .
api_idx = va_arg(pvar, int); api_idx = va_arg(pvar, int);
while (api_idx) { while (api_idx) {
if ((reason == appt_read) || !entry_ident_index_ro(api_idx, version)) 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); api_idx = va_arg(pvar, int);
} }
va_end(pvar); va_end(pvar);
@ -1268,7 +1271,7 @@ Dtcm_appointment *allocate_appt_struct (Allocation_reason reason, int version, .
for (idx = 0; idx < def_attr_count; idx++) { for (idx = 0; idx < def_attr_count; idx++) {
if ((reason == appt_write) && entry_ident_index_ro(default_appt_attrs[idx], version)) if ((reason == appt_write) && entry_ident_index_ro(default_appt_attrs[idx], version))
continue; continue;
CmDataListAdd(api_ids, (void *)default_appt_attrs[idx], 0); CmDataListAdd(api_ids, (void *) (intptr_t) default_appt_attrs[idx], 0);
} }
} }
@ -1281,20 +1284,20 @@ Dtcm_appointment *allocate_appt_struct (Allocation_reason reason, int version, .
appt->num_names = api_ids->count; appt->num_names = api_ids->count;
idx = sizeof(CSA_attribute_reference *) * appt->num_names; idx = sizeof(CSA_attribute_reference *) * appt->num_names;
appt->names = (CSA_attribute_reference *)ckalloc(idx); appt->names = (CSA_attribute_reference *)ckalloc(idx);
memset(appt->names, NULL, idx); memset(appt->names, 0, idx);
appt->count = api_ids->count; appt->count = api_ids->count;
if (reason == appt_write) { if (reason == appt_write) {
idx = sizeof(CSA_attribute) * appt->count; idx = sizeof(CSA_attribute) * appt->count;
appt->attrs = (CSA_attribute *)ckalloc(idx); 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 * Now loop through and set the names and initialize the attributes
*/ */
for (idx = 0; idx < appt->count; idx++) { 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]); appt->names[idx] = strdup(_CSA_entry_attribute_names[api_idx]);
if (reason == appt_write) if (reason == appt_write)
initialize_entry_attr(api_idx, &appt->attrs[idx], reason, version); initialize_entry_attr(api_idx, &appt->attrs[idx], reason, version);
@ -1303,7 +1306,7 @@ Dtcm_appointment *allocate_appt_struct (Allocation_reason reason, int version, .
if (reason == appt_write) if (reason == appt_write)
set_appt_links(appt); set_appt_links(appt);
CmDataListDestroy(api_ids, NULL); CmDataListDestroy(api_ids, 0);
return appt; return appt;
} }
@ -1356,7 +1359,7 @@ allocate_cal_struct(Allocation_reason reason, int version, ...) {
*/ */
idx = sizeof(Dtcm_calendar); idx = sizeof(Dtcm_calendar);
cal = (Dtcm_calendar *)ckalloc(idx); cal = (Dtcm_calendar *)ckalloc(idx);
memset(cal, NULL, idx); memset(cal, 0, idx);
cal->reason = reason; cal->reason = reason;
cal->version = version; cal->version = version;
@ -1368,7 +1371,7 @@ allocate_cal_struct(Allocation_reason reason, int version, ...) {
api_idx = va_arg(pvar, int); api_idx = va_arg(pvar, int);
while (api_idx) { while (api_idx) {
if ((reason == appt_read) || !cal_ident_index_ro(api_idx, version)) 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); api_idx = va_arg(pvar, int);
} }
va_end(pvar); va_end(pvar);
@ -1380,7 +1383,7 @@ allocate_cal_struct(Allocation_reason reason, int version, ...) {
for (idx = 0; idx < DEF_CAL_ATTR_COUNT; idx++) { for (idx = 0; idx < DEF_CAL_ATTR_COUNT; idx++) {
if ((reason == appt_write) && cal_ident_index_ro(default_cal_attrs[idx], version)) if ((reason == appt_write) && cal_ident_index_ro(default_cal_attrs[idx], version))
continue; continue;
CmDataListAdd(api_ids, (void *)default_cal_attrs[idx], 0); CmDataListAdd(api_ids, (void *) (intptr_t) default_cal_attrs[idx], 0);
} }
} }
@ -1393,20 +1396,20 @@ allocate_cal_struct(Allocation_reason reason, int version, ...) {
cal->num_names = api_ids->count; cal->num_names = api_ids->count;
idx = sizeof(CSA_attribute_reference) * cal->num_names; idx = sizeof(CSA_attribute_reference) * cal->num_names;
cal->names = (CSA_attribute_reference *)ckalloc(idx); cal->names = (CSA_attribute_reference *)ckalloc(idx);
memset(cal->names, NULL, idx); memset(cal->names, 0, idx);
cal->count = api_ids->count; cal->count = api_ids->count;
if (reason == appt_write) { if (reason == appt_write) {
idx = sizeof(CSA_attribute) * cal->count; idx = sizeof(CSA_attribute) * cal->count;
cal->attrs = (CSA_attribute *)ckalloc(idx); 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 * Now loop through and set the names and initialize the attributes
*/ */
for (idx = 0; idx < cal->count; idx++) { 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]); cal->names[idx] = strdup(_CSA_calendar_attribute_names[api_idx]);
if (reason == appt_write) if (reason == appt_write)
initialize_cal_attr(api_idx, &cal->attrs[idx], reason, version); initialize_cal_attr(api_idx, &cal->attrs[idx], reason, version);
@ -1415,7 +1418,7 @@ allocate_cal_struct(Allocation_reason reason, int version, ...) {
if (reason == appt_write) if (reason == appt_write)
set_cal_links(cal); set_cal_links(cal);
CmDataListDestroy(api_ids, NULL); CmDataListDestroy(api_ids, 0);
return cal; return cal;
@ -1455,7 +1458,7 @@ scrub_cal_attr_list(Dtcm_calendar *cal) {
for (i = 0; i < cal->count; i++) { for (i = 0; i < cal->count; i++) {
if (cal->attrs[i].value->type == CSA_VALUE_REMINDER) { if (cal->attrs[i].value->type == CSA_VALUE_REMINDER) {
if ((cal->attrs[i].value->item.reminder_value->lead_time == NULL) || 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); free(cal->attrs[i].name);
cal->attrs[i].name = NULL; cal->attrs[i].name = NULL;
} }
@ -1665,7 +1668,7 @@ initialize_cal_attr(int id, CSA_attribute *attrs, Allocation_reason reason, int
if ((reason == appt_write) && !cal_ident_index_ro(id, version)) { if ((reason == appt_write) && !cal_ident_index_ro(id, version)) {
size = sizeof(CSA_attribute_value); size = sizeof(CSA_attribute_value);
attrs->value = (CSA_attribute_value *)ckalloc(size); 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); attrs->value->type = cal_ident_index_tag(id);
if (attrs->value->type == CSA_VALUE_REMINDER) if (attrs->value->type == CSA_VALUE_REMINDER)
attrs->value->item.reminder_value = (CSA_reminder *) calloc(sizeof(CSA_reminder), 1); attrs->value->item.reminder_value = (CSA_reminder *) calloc(sizeof(CSA_reminder), 1);
@ -1709,7 +1712,7 @@ initialize_entry_attr(int id, CSA_attribute *attrs, Allocation_reason reason, in
if ((reason == appt_write) && !entry_ident_index_ro(id, version)) { if ((reason == appt_write) && !entry_ident_index_ro(id, version)) {
size = sizeof(CSA_attribute_value); size = sizeof(CSA_attribute_value);
attrs->value = (CSA_attribute_value *)ckalloc(size); 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); attrs->value->type = entry_ident_index_tag(id);
if (attrs->value->type == CSA_VALUE_REMINDER) if (attrs->value->type == CSA_VALUE_REMINDER)
attrs->value->item.reminder_value = (CSA_reminder *) calloc(sizeof(CSA_reminder), 1); attrs->value->item.reminder_value = (CSA_reminder *) calloc(sizeof(CSA_reminder), 1);
@ -1900,11 +1903,11 @@ setup_range(CSA_attribute **attrs, CSA_enum **ops, int *count, time_t start,
a_size = sizeof(CSA_attribute) * (*count); a_size = sizeof(CSA_attribute) * (*count);
attr_ptr = (CSA_attribute *)ckalloc(a_size); 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); o_size = sizeof(CSA_enum) * (*count);
op_ptr = (CSA_enum *)ckalloc(o_size); 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); initialize_entry_attr(CSA_ENTRY_ATTR_START_DATE_I, &attr_ptr[0], appt_write, version);
attr_ptr[0].value->item.string_value = malloc(BUFSIZ); attr_ptr[0].value->item.string_value = malloc(BUFSIZ);

View file

@ -539,7 +539,7 @@ _DtCmsDoUpdateEntryCallback(
if (newid > 0) if (newid > 0)
sprintf(nbuf, "%ld", newid); sprintf(nbuf, "%ld", newid);
else else
nbuf[0] = NULL; nbuf[0] = '\0';
udata.newid = nbuf; udata.newid = nbuf;
udata.scope = scope; udata.scope = scope;
udata.time = time; udata.time = time;

View file

@ -292,7 +292,7 @@ _DtCmsSetFileVersion(_DtCmsCalendar *cal, int version)
if ((cal->types = (int *)calloc(1, sizeof(int) * if ((cal->types = (int *)calloc(1, sizeof(int) *
(_DtCm_entry_name_tbl->size + 1))) == NULL) { (_DtCm_entry_name_tbl->size + 1))) == NULL) {
_DtCmsFreeCalendar(cal); _DtCmsFreeCalendar(cal);
return (NULL); return (0);
} else } else
_DtCm_get_attribute_types(_DtCm_entry_name_tbl->size, _DtCm_get_attribute_types(_DtCm_entry_name_tbl->size,
cal->types); cal->types);
@ -476,7 +476,7 @@ _DtCmsGetCalendarByName(char *target, boolean_t load, _DtCmsCalendar **cal)
_DtCmsCalendar *clist = calendar_list; _DtCmsCalendar *clist = calendar_list;
if ((name = get_calname(target)) == NULL) if ((name = get_calname(target)) == NULL)
return (NULL); return (0);
while (clist != NULL) { while (clist != NULL) {
if (strcmp (name, clist->calendar) == 0) { if (strcmp (name, clist->calendar) == 0) {
@ -1033,7 +1033,7 @@ get_calname(char *target)
if (ptr == NULL) { if (ptr == NULL) {
return (strdup(target)); return (strdup(target));
} else { } else {
*ptr = NULL; *ptr = '\0';
name = strdup(target); name = strdup(target);
*ptr = '@'; *ptr = '@';
return (name); return (name);

View file

@ -1239,7 +1239,7 @@ _DtCmsCreateCallog(char *user, cms_create_args *args, _DtCmsCalendar **newcal)
/* use passed in char set if client does not supply one */ /* use passed in char set if client does not supply one */
if (cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value == NULL && 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, if ((stat = _DtCm_set_string_attrval(args->char_set,
&cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value, &cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value,
CSA_VALUE_STRING)) != CSA_SUCCESS) { CSA_VALUE_STRING)) != CSA_SUCCESS) {
@ -1335,7 +1335,7 @@ _grow_char_array(void *ptr, uint oldcount, uint newcount)
void *nptr; void *nptr;
if (nptr = realloc(ptr, newcount)) { if (nptr = realloc(ptr, newcount)) {
memset((void *)((char *)nptr + oldcount), NULL, memset((void *)((char *)nptr + oldcount), 0,
newcount - oldcount); newcount - oldcount);
return (nptr); return (nptr);
} else } else

View file

@ -112,7 +112,7 @@ static u_int sendit_value[255];
#define TVAL(a,b) { #a,-1, -1, &externTag.tag,b,TAGSVAL } #define TVAL(a,b) { #a,-1, -1, &externTag.tag,b,TAGSVAL }
#define SVAL(a,b) { #a,-1, -1, &externPrivacy,b,PRIVACYVAL} #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[] = { token_data_t tokens[] = {
PVAL(single, single_4), PVAL(single, single_4),
@ -305,7 +305,7 @@ yyylex()
unput_char(); unput_char();
*ptr = NULL; *ptr = '\0';
externNumberVal=atoi((char *)parse_buffer); externNumberVal=atoi((char *)parse_buffer);
return(NUMBER); return(NUMBER);
@ -320,7 +320,7 @@ yyylex()
unput_char(); unput_char();
*ptr = NULL; *ptr = '\0';
if ((bucket = tokens[hash_string((char *) parse_buffer)].first_token) if ((bucket = tokens[hash_string((char *) parse_buffer)].first_token)
== -1) { == -1) {

View file

@ -319,9 +319,9 @@ _DtCmsAppendAppt4ByFD(int f, Appt_4 *appt, _DtCmsLogOps op)
and 1 BUFSIZ for the rest */ and 1 BUFSIZ for the rest */
cptr = ctime (&appt->appt_id.tick); 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) { switch (op) {
case _DtCmsLogAdd: case _DtCmsLogAdd:
sprintf(buf, "(add \"%s\" key: %ld ", cptr, appt->appt_id.key); sprintf(buf, "(add \"%s\" key: %ld ", cptr, appt->appt_id.key);
@ -354,7 +354,7 @@ _DtCmsAppendAppt4ByFD(int f, Appt_4 *appt, _DtCmsLogOps op)
} }
if (appt->period.enddate != 0) { if (appt->period.enddate != 0) {
cptr = ctime (&(appt->period.enddate)); cptr = ctime (&(appt->period.enddate));
cptr[24] = NULL; /* strip off CR */ cptr[24] = '\0'; /* strip off CR */
sprintf(buf2, "enddate: \"%s\" ", cptr); sprintf(buf2, "enddate: \"%s\" ", cptr);
strcat(buf, buf2); strcat(buf, buf2);
} }
@ -494,7 +494,7 @@ _DtCmsPrintAppt4(caddr_t data)
fprintf(stderr, "*** V4 appointement: ***\n\n"); fprintf(stderr, "*** V4 appointement: ***\n\n");
tmstr = ctime (&appt->appt_id.tick); 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) { if (fprintf(stderr, "(add \"%s\" ", tmstr)==EOF) {
return (B_TRUE); return (B_TRUE);
@ -520,7 +520,7 @@ _DtCmsPrintAppt4(caddr_t data)
return (B_TRUE); return (B_TRUE);
} }
buf[0]=NULL; buf[0] = '\0';
periodtostr (appt->period.period, buf); periodtostr (appt->period.period, buf);
if (fprintf(stderr, "period: %s ", buf) == EOF) if (fprintf(stderr, "period: %s ", buf) == EOF)
return (B_TRUE); return (B_TRUE);
@ -531,7 +531,7 @@ _DtCmsPrintAppt4(caddr_t data)
} }
if (appt->period.enddate != 0) { if (appt->period.enddate != 0) {
tmstr = ctime (&(appt->period.enddate)); tmstr = ctime (&(appt->period.enddate));
tmstr[24] = NULL; /* strip off CR */ tmstr[24] = '\0'; /* strip off CR */
if (fprintf(stderr, "enddate: \"%s\" ", tmstr) == EOF) if (fprintf(stderr, "enddate: \"%s\" ", tmstr) == EOF)
return (B_TRUE); return (B_TRUE);
} }
@ -573,7 +573,7 @@ _DtCmsPrintAppt4(caddr_t data)
if (fprintf(stderr, "tags: (") == EOF) if (fprintf(stderr, "tags: (") == EOF)
return (B_TRUE); return (B_TRUE);
while(item != NULL) { while(item != NULL) {
buf[0]=NULL; buf[0] = '\0';
tagstostr(item->tag, buf); tagstostr(item->tag, buf);
if (fprintf(stderr, "(%s , %d)", buf, item->showtime) if (fprintf(stderr, "(%s , %d)", buf, item->showtime)
== EOF) == EOF)
@ -585,12 +585,12 @@ _DtCmsPrintAppt4(caddr_t data)
} }
buf[0]=NULL; buf[0] = '\0';
apptstatustostr(appt->appt_status, buf); apptstatustostr(appt->appt_status, buf);
if (fprintf(stderr, "apptstat: %s ", buf) == EOF) if (fprintf(stderr, "apptstat: %s ", buf) == EOF)
return (B_TRUE); return (B_TRUE);
buf[0]=NULL; buf[0] = '\0';
privacytostr(appt->privacy, buf); privacytostr(appt->privacy, buf);
if (fprintf(stderr, "privacy: %s )\n", buf) == EOF) if (fprintf(stderr, "privacy: %s )\n", buf) == EOF)
return (B_TRUE); return (B_TRUE);
@ -647,8 +647,11 @@ _DtCmsTruncateFile(char *calendar, int size)
return; return;
/* truncate log file to specified size */ /* truncate log file to specified size */
if ((f = open(log, O_RDWR | O_APPEND | O_SYNC)) >= 0) if ((f = open(log, O_RDWR | O_APPEND | O_SYNC)) >= 0) {
ftruncate(f, size); if(-1 == ftruncate(f, size)) {
perror(strerror(errno));
}
}
free(log); free(log);
} }
@ -691,12 +694,12 @@ _DtCmsWriteVersionString(char *file, int version)
tmval = time((time_t *) 0); tmval = time((time_t *) 0);
tm = _XLocaltime(&tmval, localtime_buf); tm = _XLocaltime(&tmval, localtime_buf);
tmstr = _XAsctime(tm, asctime_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 ((fd = open(file, O_WRONLY|O_TRUNC|O_SYNC)) < 0) {
if (debug) if (debug)
fprintf(stderr, "%s: failed to open %s in %s\n", fprintf(stderr, "%s: failed to open %s\n",
pgname, file, _DtCmsWriteVersionString); pgname, file);
return (CSA_X_DT_E_BACKING_STORE_PROBLEM); return (CSA_X_DT_E_BACKING_STORE_PROBLEM);
} }
@ -733,7 +736,9 @@ _DtCmsSetFileMode(
#ifdef HPUX #ifdef HPUX
setuid (0); setuid (0);
#else #else
seteuid (0); if(-1 == seteuid (0)) {
perror(strerror(errno));
}
#endif #endif
#endif #endif
} }
@ -784,7 +789,7 @@ static void
periodtostr(Interval_4 i, char *q) periodtostr(Interval_4 i, char *q)
{ {
if (q==NULL) return; if (q==NULL) return;
q[0]=NULL; q[0] = '\0';
switch (i) { switch (i) {
case single_4: case single_4:
strcpy (q, "single"); strcpy (q, "single");
@ -838,7 +843,7 @@ static void
privacytostr(Privacy_Level_4 p, char *q) privacytostr(Privacy_Level_4 p, char *q)
{ {
if (q==NULL) return; if (q==NULL) return;
q[0]=NULL; q[0] = '\0';
switch(p) { switch(p) {
case public_4: case public_4:
strcpy(q, "public"); strcpy(q, "public");
@ -859,7 +864,7 @@ static void
apptstatustostr(Appt_Status_4 p, char *q) apptstatustostr(Appt_Status_4 p, char *q)
{ {
if (q==NULL) return; if (q==NULL) return;
q[0]=NULL; q[0] = '\0';
switch(p) { switch(p) {
case active_4: case active_4:
strcpy(q, "active"); strcpy(q, "active");
@ -889,7 +894,7 @@ static void
tagstostr(Event_Type_4 p, char *q) tagstostr(Event_Type_4 p, char *q)
{ {
if (q==NULL) return; if (q==NULL) return;
q[0]=NULL; q[0] = '\0';
switch(p) { switch(p) {
case appointment_4: case appointment_4:
strcpy(q, "appointment"); strcpy(q, "appointment");
@ -933,7 +938,7 @@ create_log(char *owner, char *file, int version)
CSA_return_code stat; CSA_return_code stat;
ptr = strchr(owner, '@'); ptr = strchr(owner, '@');
if (ptr) *ptr = NULL; if (ptr) *ptr = '\0';
pw = getpwnam (owner); pw = getpwnam (owner);
if (ptr) *ptr = '@'; if (ptr) *ptr = '@';
if (pw == NULL) if (pw == NULL)
@ -993,7 +998,10 @@ append_log(int f, char *buf)
status = CSA_X_DT_E_BACKING_STORE_PROBLEM; status = CSA_X_DT_E_BACKING_STORE_PROBLEM;
perror(pgname); 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); return (status);
} }
@ -1068,7 +1076,7 @@ attrs_to_attrliststr(
if ((buf = malloc(BUFSIZ+1)) == NULL) return (NULL); if ((buf = malloc(BUFSIZ+1)) == NULL) return (NULL);
tcount = BUFSIZ; 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 && if (attrs[i].value == NULL || (entryattrs &&
(i == CSA_ENTRY_ATTR_NUMBER_RECURRENCES_I || (i == CSA_ENTRY_ATTR_NUMBER_RECURRENCES_I ||
@ -1089,7 +1097,7 @@ attrs_to_attrliststr(
/* value string */ /* value string */
body = NULL; body = NULL;
*tmpbuf2 = NULL; *tmpbuf2 = '\0';
switch (attrs[i].value->type) { switch (attrs[i].value->type) {
case CSA_VALUE_ENUMERATED: case CSA_VALUE_ENUMERATED:
case CSA_VALUE_SINT32: case CSA_VALUE_SINT32:
@ -1207,7 +1215,7 @@ attrs_to_attrliststr(
tcount += BUFSIZ; tcount += BUFSIZ;
} }
strcat(buf, tmpbuf); strcat(buf, tmpbuf);
if (*tmpbuf2 != NULL) strcat(buf, tmpbuf2); if (*tmpbuf2 != '\0') strcat(buf, tmpbuf2);
if (body) strcat(buf, body); if (body) strcat(buf, body);
strcat(buf, "\")\n"); strcat(buf, "\")\n");
if (body) free(body); if (body) free(body);
@ -1280,7 +1288,7 @@ cr_to_str(char *s, int size)
k++; k++;
} }
} }
newstr[k] = NULL; newstr[k] = '\0';
return(newstr); return(newstr);
} }

View file

@ -272,7 +272,7 @@ appointmentBody : tick key what details duration period nth enddate ntimes excep
newp->author = $12; newp->author = $12;
newp->attr = $13; newp->attr = $13;
if (temp != NULL && (*temp)!=NULL) { if (temp != NULL && (*temp)!='\0') {
item = newp->attr; item = newp->attr;
while(item!=NULL) { while(item!=NULL) {
if(strcmp(item->attr, "ml")==0) { if(strcmp(item->attr, "ml")==0) {
@ -372,7 +372,7 @@ mailto : /* empty */
duration : /* empty */ duration : /* empty */
{ {
$$ = NULL; $$ = '\0';
} }
| DURATION COLON number | DURATION COLON number
{ {
@ -693,7 +693,7 @@ str_to_cr(char *s)
} }
k++; k++;
} }
newstr[k] = NULL; newstr[k] = '\0';
return(newstr); return(newstr);
} }
@ -763,7 +763,7 @@ convert_2_tick(char *datestr)
if (datestr == NULL) if (datestr == NULL)
return (-1); return (-1);
memset((void *)&tmstr, NULL, sizeof(struct tm)); memset((void *)&tmstr, 0, sizeof(struct tm));
strcpy(datebuf, datestr); strcpy(datebuf, datestr);
@ -791,7 +791,7 @@ convert_2_tick(char *datestr)
if ((tptr = strchr(ptr, ':')) == NULL) if ((tptr = strchr(ptr, ':')) == NULL)
return (-1); return (-1);
else { else {
*tptr = NULL; *tptr = '\0';
tmstr.tm_hour = atoi(ptr); tmstr.tm_hour = atoi(ptr);
} }
@ -799,7 +799,7 @@ convert_2_tick(char *datestr)
if ((tptr = strchr(ptr, ':')) == NULL) if ((tptr = strchr(ptr, ':')) == NULL)
return (-1); return (-1);
else { else {
*tptr = NULL; *tptr = '\0';
tmstr.tm_min = atoi(ptr); tmstr.tm_min = atoi(ptr);
} }
@ -907,11 +907,11 @@ get_attr_value(int type, char *valstr, cms_attribute_value **attrval)
stat = _DtCm_set_string_attrval(valstr, attrval, type); stat = _DtCm_set_string_attrval(valstr, attrval, type);
break; break;
case CSA_VALUE_REMINDER: case CSA_VALUE_REMINDER:
memset((void *)&remval, NULL, sizeof (CSA_reminder)); memset((void *)&remval, 0, sizeof (CSA_reminder));
if (ptr1 = strchr(valstr, ':')) { if (ptr1 = strchr(valstr, ':')) {
*ptr1++ = NULL; *ptr1++ = '\0';
if (ptr2 = strchr(ptr1, ':')) { if (ptr2 = strchr(ptr1, ':')) {
*ptr2++ = NULL; *ptr2++ = '\0';
ptr3 = strchr(ptr2, ':'); ptr3 = strchr(ptr2, ':');
} }
} }
@ -929,9 +929,9 @@ get_attr_value(int type, char *valstr, cms_attribute_value **attrval)
stat = _DtCm_set_reminder_attrval(&remval, attrval); stat = _DtCm_set_reminder_attrval(&remval, attrval);
} else { } else {
/* format = "string:string:number:number:string" */ /* format = "string:string:number:number:string" */
*ptr3++ = NULL; *ptr3++ = '\0';
if (ptr4 = strchr(ptr3, ':')) { if (ptr4 = strchr(ptr3, ':')) {
*ptr4++ = NULL; *ptr4++ = '\0';
remval.lead_time = valstr; remval.lead_time = valstr;
remval.snooze_time = ptr1; remval.snooze_time = ptr1;
remval.repeat_count = atoi(ptr2); remval.repeat_count = atoi(ptr2);
@ -953,7 +953,7 @@ get_attr_value(int type, char *valstr, cms_attribute_value **attrval)
break; break;
case CSA_VALUE_OPAQUE_DATA: case CSA_VALUE_OPAQUE_DATA:
if (ptr1 = strchr(valstr, ':')) { if (ptr1 = strchr(valstr, ':')) {
*ptr1++ = NULL; *ptr1++ = '\0';
opqval.size = atoi(valstr); opqval.size = atoi(valstr);
opqval.data = (unsigned char *)ptr1; opqval.data = (unsigned char *)ptr1;
stat = _DtCm_set_opaque_attrval(&opqval, attrval); stat = _DtCm_set_opaque_attrval(&opqval, attrval);
@ -1042,7 +1042,7 @@ get_user_access_entry(char *string, cms_access_entry **a)
return (CSA_E_INSUFFICIENT_MEMORY); return (CSA_E_INSUFFICIENT_MEMORY);
} }
*ptr = NULL; *ptr = '\0';
if ((item->user = strdup(string)) == NULL) { if ((item->user = strdup(string)) == NULL) {
free(item); free(item);
return (CSA_E_INSUFFICIENT_MEMORY); return (CSA_E_INSUFFICIENT_MEMORY);
@ -1070,7 +1070,7 @@ grow_attr_array(_attr_array *attrs)
attrs->total += _DEFAULT_ARRAY_SIZE; attrs->total += _DEFAULT_ARRAY_SIZE;
attrs->attrs = newptr; attrs->attrs = newptr;
memset((void *)&attrs->attrs[attrs->current], NULL, memset((void *)&attrs->attrs[attrs->current], 0,
sizeof(cms_attribute)*_DEFAULT_ARRAY_SIZE); sizeof(cms_attribute)*_DEFAULT_ARRAY_SIZE);
} }

View file

@ -352,7 +352,7 @@ DoWeek(
if (_target_time) { if (_target_time) {
if (!(unused = InitRepeatEventState(re))) if (!(unused = InitRepeatEventState(re)))
return (Tick)NULL; return (Tick)NULL;
start_time = DoWeek(NULL, _start_time, re, unused); start_time = DoWeek(0, _start_time, re, unused);
free(unused); free(unused);
if (_target_time < start_time) if (_target_time < start_time)
target_time = start_time; target_time = start_time;
@ -677,7 +677,7 @@ DoYearByMonth(
if (_target_time) { if (_target_time) {
if (!(unused = InitRepeatEventState(re))) if (!(unused = InitRepeatEventState(re)))
return (Tick)NULL; return (Tick)NULL;
start_time = DoYearByMonth(NULL, _start_time, re, unused); start_time = DoYearByMonth(0, _start_time, re, unused);
free(unused); free(unused);
if (_target_time < start_time) if (_target_time < start_time)
target_time = start_time; target_time = start_time;
@ -781,7 +781,7 @@ DoYearByDay(
if (_target_time) { if (_target_time) {
if (!(unused = InitRepeatEventState(re))) if (!(unused = InitRepeatEventState(re)))
return (Tick)NULL; return (Tick)NULL;
start_time = DoYearByDay(NULL, _start_time, re, unused); start_time = DoYearByDay(0, _start_time, re, unused);
free(unused); free(unused);
if (_target_time < start_time) if (_target_time < start_time)
target_time = start_time; target_time = start_time;

View file

@ -76,7 +76,7 @@ static int monthsecs[12] = {
31*daysec, 30*daysec, 31*daysec 31*daysec, 30*daysec, 31*daysec
}; };
extern int monthdays[12] = { int monthdays[12] = {
31, 28, 31, 31, 28, 31,
30, 31, 30, 30, 31, 30,
31, 31, 30, 31, 31, 30,

View file

@ -106,7 +106,7 @@ ReToString(
strcat (cmd_buf, subcommand); strcat (cmd_buf, subcommand);
} }
memset (subcommand, NULL, 1024); memset (subcommand, 0, 1024);
re = re->re_next; re = re->re_next;
} }

View file

@ -305,7 +305,7 @@ DeriveNewStartTime(
* time should be. * time should be.
*/ */
while (--num_events && while (--num_events &&
(an_event = PrevTick(an_event, NULL, new_re, res))) { (an_event = PrevTick(an_event, 0, new_re, res))) {
; ;
} }

View file

@ -112,7 +112,7 @@ _GetGtime(char *timestr)
} }
minute = atoi(&timestr[len - 2]); minute = atoi(&timestr[len - 2]);
timestr[len - 2] = NULL; timestr[len - 2] = '\0';
hour = atoi(timestr); hour = atoi(timestr);
if (hour > 23 || minute > 59) if (hour > 23 || minute > 59)
@ -273,7 +273,9 @@ init_dir()
} }
/* Change current directory, so core file can be dumped. */ /* Change current directory, so core file can be dumped. */
chdir (dir); if(-1 == chdir (dir)) {
perror(strerror(errno));
}
} }
/* /*
@ -754,8 +756,12 @@ main(int argc, char **argv)
setgid (daemon_gid); setgid (daemon_gid);
setuid (daemon_uid); setuid (daemon_uid);
#else #else
setegid (daemon_gid); if(-1 == setegid (daemon_gid)) {
seteuid (daemon_uid); perror(strerror(errno));
}
if(-1 == seteuid (daemon_uid)) {
perror(strerror(errno));
}
#endif /* HPUX */ #endif /* HPUX */
#endif /* AIX */ #endif /* AIX */

View file

@ -319,14 +319,14 @@ _DtCmsUpdateDurationInRule(cms_entry *entry, uint remain)
sprintf(buf, "#%d", remain); sprintf(buf, "#%d", remain);
if (ptr = strchr(vptr->item.string_value, '#')) { if (ptr = strchr(vptr->item.string_value, '#')) {
*ptr = NULL; *ptr = '\0';
strcpy(newrule, vptr->item.string_value); strcpy(newrule, vptr->item.string_value);
strcat(newrule, buf); strcat(newrule, buf);
if (ptr = strchr(ptr + 1, ' ')) if (ptr = strchr(ptr + 1, ' '))
strcat(newrule, ptr); strcat(newrule, ptr);
} else { } else {
if (ptr = strchr(vptr->item.string_value, ' ')) { if (ptr = strchr(vptr->item.string_value, ' ')) {
*ptr = NULL; *ptr = '\0';
sprintf(newrule, "%s %s %s", vptr->item.string_value, sprintf(newrule, "%s %s %s", vptr->item.string_value,
buf, ptr+1); buf, ptr+1);
} else } else