mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
dtcm: Resolve format-overflow issues
This commit is contained in:
parent
5f784d1013
commit
04fcc11f12
11 changed files with 17 additions and 18 deletions
|
@ -1417,7 +1417,7 @@ mb_draw_chartgrid(Browser *b, Calendar *c)
|
||||||
Props *p = (Props*)c->properties;
|
Props *p = (Props*)c->properties;
|
||||||
XFontSetExtents fontextents;
|
XFontSetExtents fontextents;
|
||||||
int char_height, char_width;
|
int char_height, char_width;
|
||||||
char label[5], buf[160];
|
char label[12], buf[160];
|
||||||
new_XContext *xc = b->xcontext;
|
new_XContext *xc = b->xcontext;
|
||||||
int dayy, dayweek;
|
int dayy, dayweek;
|
||||||
Tick daytick;
|
Tick daytick;
|
||||||
|
|
|
@ -200,7 +200,7 @@ prompt_for_insert(Props *p) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "%s %s", date_str, cm_start);
|
snprintf(buf, sizeof(buf), "%s %s", date_str, cm_start);
|
||||||
next = (int) cm_getdate(buf, NULL);
|
next = (int) cm_getdate(buf, NULL);
|
||||||
next = next + hrsec;
|
next = next + hrsec;
|
||||||
|
|
||||||
|
|
|
@ -923,7 +923,7 @@ static int
|
||||||
day_xytoclock(Calendar *c, int x, int y, Tick t)
|
day_xytoclock(Calendar *c, int x, int y, Tick t)
|
||||||
{
|
{
|
||||||
int daybegin, hr, val;
|
int daybegin, hr, val;
|
||||||
char buf[10];
|
char buf[36];
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
Props *p;
|
Props *p;
|
||||||
_Xltimeparams localtime_buf;
|
_Xltimeparams localtime_buf;
|
||||||
|
|
|
@ -579,7 +579,7 @@ dssw_form_flags_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t, int
|
||||||
} else
|
} else
|
||||||
ampm_buf[0] = '\0';
|
ampm_buf[0] = '\0';
|
||||||
|
|
||||||
sprintf(buf, "%s %s%s",
|
snprintf(buf, sizeof(buf), "%s %s%s",
|
||||||
dssw->date_val, dssw->start_val.val, ampm_buf);
|
dssw->date_val, dssw->start_val.val, ampm_buf);
|
||||||
|
|
||||||
if (!blank_buf(dssw->stop_val.val)
|
if (!blank_buf(dssw->stop_val.val)
|
||||||
|
@ -627,7 +627,7 @@ dssw_form_flags_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t, int
|
||||||
} else
|
} else
|
||||||
ampm_buf[0] = '\0';
|
ampm_buf[0] = '\0';
|
||||||
|
|
||||||
sprintf(buf, "%s %s%s", dssw->date_val,
|
snprintf(buf, sizeof(buf), "%s %s%s", dssw->date_val,
|
||||||
dssw->stop_val.val, ampm_buf);
|
dssw->stop_val.val, ampm_buf);
|
||||||
if ((stop_tick = cm_getdate(buf, NULL)) <= 0) {
|
if ((stop_tick = cm_getdate(buf, NULL)) <= 0) {
|
||||||
editor_err_msg(dssw->parent, name, INVALID_DATE,
|
editor_err_msg(dssw->parent, name, INVALID_DATE,
|
||||||
|
@ -719,7 +719,7 @@ dssw_form_to_todo(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t)
|
||||||
} else
|
} else
|
||||||
ampm_buf[0] = '\0';
|
ampm_buf[0] = '\0';
|
||||||
|
|
||||||
sprintf(buf, "%s %s%s",
|
snprintf(buf, sizeof(buf), "%s %s%s",
|
||||||
dssw->date_val, dssw->start_val.val, ampm_buf);
|
dssw->date_val, dssw->start_val.val, ampm_buf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -713,8 +713,7 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs
|
||||||
(const time_t *)&new_tick->tick,
|
(const time_t *)&new_tick->tick,
|
||||||
localtime_buf));
|
localtime_buf));
|
||||||
fmt_time_what(appt, what_buf, dt);
|
fmt_time_what(appt, what_buf, dt);
|
||||||
sprintf (buf2, "%10s %s",
|
snprintf(buf2, sizeof(buf2), "%10s %s", buf, what_buf);
|
||||||
buf, what_buf);
|
|
||||||
buf_str = XmStringCreateLocalized(buf2);
|
buf_str = XmStringCreateLocalized(buf2);
|
||||||
XmListAddItem(f->find_list, buf_str, 0);
|
XmListAddItem(f->find_list, buf_str, 0);
|
||||||
XmStringFree(buf_str);
|
XmStringFree(buf_str);
|
||||||
|
|
|
@ -299,7 +299,7 @@ make_timezone(Calendar *c)
|
||||||
cm_strcpy(tmp_buf, (char*)getenv("TZ"));
|
cm_strcpy(tmp_buf, (char*)getenv("TZ"));
|
||||||
cm_strcpy(t->mytimezone, tmp_buf);
|
cm_strcpy(t->mytimezone, tmp_buf);
|
||||||
|
|
||||||
sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"),
|
snprintf(buf, sizeof(buf), "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"),
|
||||||
t->mytimezone);
|
t->mytimezone);
|
||||||
set_message(t->timezone_message, buf);
|
set_message(t->timezone_message, buf);
|
||||||
set_message(c->message_text, buf);
|
set_message(c->message_text, buf);
|
||||||
|
@ -385,7 +385,7 @@ tz_set_timezone(Calendar *c, Timezone *t)
|
||||||
if (t->timezone_type == mytime)
|
if (t->timezone_type == mytime)
|
||||||
{
|
{
|
||||||
set_timezone(t->mytimezone);
|
set_timezone(t->mytimezone);
|
||||||
sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"),
|
snprintf(buf, sizeof(buf), "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"),
|
||||||
t->mytimezone);
|
t->mytimezone);
|
||||||
|
|
||||||
/* get utc time */
|
/* get utc time */
|
||||||
|
@ -413,7 +413,7 @@ tz_set_timezone(Calendar *c, Timezone *t)
|
||||||
cm_strcpy(t->gmttimezone, tmp_buf);
|
cm_strcpy(t->gmttimezone, tmp_buf);
|
||||||
sprintf(gmt, "GMT%s", tmp_buf);
|
sprintf(gmt, "GMT%s", tmp_buf);
|
||||||
set_timezone(gmt);
|
set_timezone(gmt);
|
||||||
sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), gmt);
|
snprintf(buf, sizeof(buf), "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), gmt);
|
||||||
}
|
}
|
||||||
set_message(t->timezone_message, buf);
|
set_message(t->timezone_message, buf);
|
||||||
paint_canvas(c, NULL, RENDER_CLEAR_FIRST);
|
paint_canvas(c, NULL, RENDER_CLEAR_FIRST);
|
||||||
|
|
|
@ -2212,7 +2212,7 @@ build_todo_view(ToDo *t, Glance glance, Boolean redisplay) {
|
||||||
step = (TodoView *)ckalloc(sizeof(TodoView));
|
step = (TodoView *)ckalloc(sizeof(TodoView));
|
||||||
|
|
||||||
sprintf(str1, "%d", cnt);
|
sprintf(str1, "%d", cnt);
|
||||||
sprintf(str2, "%s.", str1);
|
sprintf(str2, "%d.", cnt);
|
||||||
str = XmStringCreateLocalized(str2);
|
str = XmStringCreateLocalized(str2);
|
||||||
step->view_item_number = XtVaCreateManagedWidget("cnt",
|
step->view_item_number = XtVaCreateManagedWidget("cnt",
|
||||||
xmLabelGadgetClass, t->view_form_mgr,
|
xmLabelGadgetClass, t->view_form_mgr,
|
||||||
|
|
|
@ -1186,7 +1186,7 @@ draw_chart(Calendar *c, Week *w, XRectangle *rect)
|
||||||
int n;
|
int n;
|
||||||
XFontSetExtents fontextents;
|
XFontSetExtents fontextents;
|
||||||
int char_height;
|
int char_height;
|
||||||
char label[5];
|
char label[12];
|
||||||
new_XContext *xc = c->xcontext;
|
new_XContext *xc = c->xcontext;
|
||||||
Props *p = (Props*)c->properties;
|
Props *p = (Props*)c->properties;
|
||||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||||
|
|
|
@ -2660,7 +2660,7 @@ x_print_header(void *gInfoP, char *buf, int pageNum, int numPages)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(pageStr, "%s %d %s %d", str2, pageNum, str, numPages);
|
snprintf(pageStr, sizeof(pageStr), "%s %d %s %d", str2, pageNum, str, numPages);
|
||||||
|
|
||||||
/* Header/footer strings are all set - print 'em! */
|
/* Header/footer strings are all set - print 'em! */
|
||||||
cm_print_header_string(gInfo, CP_PRINTLHEADER,
|
cm_print_header_string(gInfo, CP_PRINTLHEADER,
|
||||||
|
@ -3186,7 +3186,7 @@ x_print_todo(void *gInfoP, CSA_entry_handle *list, int a_total,
|
||||||
_csa_iso8601_to_tick(appt->time->value->item.date_time_value,
|
_csa_iso8601_to_tick(appt->time->value->item.date_time_value,
|
||||||
&start_tick);
|
&start_tick);
|
||||||
format_date3(start_tick, ot, st, buf2);
|
format_date3(start_tick, ot, st, buf2);
|
||||||
sprintf(buf3, "%s %s", buf2, buf1);
|
snprintf(buf3, sizeof(buf3), "%s %s", buf2, buf1);
|
||||||
} else
|
} else
|
||||||
cm_strcpy(buf3, buf1);
|
cm_strcpy(buf3, buf1);
|
||||||
|
|
||||||
|
|
|
@ -650,7 +650,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date,
|
||||||
format_time(end_tick, dt, end_buf);
|
format_time(end_tick, dt, end_buf);
|
||||||
else
|
else
|
||||||
*end_buf = '\0';
|
*end_buf = '\0';
|
||||||
sprintf(buf, "%s%c%7s ", start_buf,
|
snprintf(buf, sizeof(buf), "%s%c%7s ", start_buf,
|
||||||
(*end_buf ? '-' : ' '), end_buf);
|
(*end_buf ? '-' : ' '), end_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1747,7 +1747,7 @@ attrs_to_string(CSA_attribute * attrs, int num_attrs)
|
||||||
|
|
||||||
growcat(&buffer, tmp_buf);
|
growcat(&buffer, tmp_buf);
|
||||||
_csa_iso8601_to_duration(attrs[i].value->item.reminder_value->lead_time, &advance_time);
|
_csa_iso8601_to_duration(attrs[i].value->item.reminder_value->lead_time, &advance_time);
|
||||||
sprintf(tmp_buf, "reminder:%d:", advance_time);
|
sprintf(tmp_buf, "reminder:%ld:", (long) advance_time);
|
||||||
growcat(&buffer, tmp_buf);
|
growcat(&buffer, tmp_buf);
|
||||||
if (attrs[i].value->item.reminder_value->reminder_data.data)
|
if (attrs[i].value->item.reminder_value->reminder_data.data)
|
||||||
cat_indented_string(&buffer,
|
cat_indented_string(&buffer,
|
||||||
|
|
|
@ -129,7 +129,7 @@ NumsToBuf(
|
||||||
{
|
{
|
||||||
int i,
|
int i,
|
||||||
size = 0;
|
size = 0;
|
||||||
char tmp_buf[32],
|
char tmp_buf[34],
|
||||||
tmp_buf2[32];
|
tmp_buf2[32];
|
||||||
|
|
||||||
for (i = 0; i < array_size; i++) {
|
for (i = 0; i < array_size; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue