Commit 885d1d74 authored by Paul Eggert's avatar Paul Eggert

* xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string

instead of truncating it to 63 (admittedly a generous limit).
parent d188e26b
2012-06-24 Paul Eggert <eggert@cs.ucla.edu> 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
* xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
instead of truncating it to 63 (admittedly a generous limit).
* process.c: Fix spelling and caps in comments. * process.c: Fix spelling and caps in comments.
2012-06-24 Dan Nicolaescu <dann@ics.uci.edu> 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
......
...@@ -10375,14 +10375,16 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) ...@@ -10375,14 +10375,16 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
const int total_atom_count = 1 + atom_count; const int total_atom_count = 1 + atom_count;
Atom *atoms_return = xmalloc (sizeof (Atom) * total_atom_count); Atom *atoms_return = xmalloc (sizeof (Atom) * total_atom_count);
char **atom_names = xmalloc (sizeof (char *) * total_atom_count); char **atom_names = xmalloc (sizeof (char *) * total_atom_count);
char xsettings_atom_name[64]; static char const xsettings_fmt[] = "_XSETTINGS_S%d";
char xsettings_atom_name[sizeof xsettings_fmt - 2
+ INT_STRLEN_BOUND (int)];
for (i = 0; i < atom_count; i++) for (i = 0; i < atom_count; i++)
atom_names[i] = (char *) atom_refs[i].name; atom_names[i] = (char *) atom_refs[i].name;
/* Build _XSETTINGS_SN atom name */ /* Build _XSETTINGS_SN atom name */
snprintf (xsettings_atom_name, sizeof (xsettings_atom_name), sprintf (xsettings_atom_name, xsettings_fmt,
"_XSETTINGS_S%d", XScreenNumberOfScreen (dpyinfo->screen)); XScreenNumberOfScreen (dpyinfo->screen));
atom_names[i] = xsettings_atom_name; atom_names[i] = xsettings_atom_name;
XInternAtoms (dpyinfo->display, atom_names, total_atom_count, XInternAtoms (dpyinfo->display, atom_names, total_atom_count,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment