1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

(x_list_fonts): Keep alloca usage simple.

This commit is contained in:
Karl Heuer 1998-06-20 22:17:48 +00:00
parent 94487c4e37
commit 01c752b506

View File

@ -6474,10 +6474,12 @@ x_list_fonts (f, pattern, size, maxnames)
{
char *name = (char *) XGetAtomName (dpy, (Atom) value);
int len = strlen (name);
char *tmp;
num_fonts = 1;
names = alloca (sizeof (char *));
names[0] = alloca (len + 1);
/* Some systems only allow alloca assigned to a simple var. */
tmp = alloca (len + 1); names[0] = tmp;
bcopy (name, names[0], len + 1);
XFree (name);
}