Commit 35016e9a authored by Paul Eggert's avatar Paul Eggert

* callproc.c (child_setup): Rewrite to avoid two strlen calls.

parent 3d1e65a1
2011-06-19 Paul Eggert <eggert@cs.ucla.edu>
* callproc.c (child_setup): Rewrite to avoid two strlen calls.
* process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
We prefer signed integers, even for size calculations.
......
......@@ -1230,8 +1230,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
if (STRINGP (display))
{
int vlen = strlen ("DISPLAY=") + strlen (SSDATA (display)) + 1;
char *vdata = (char *) alloca (vlen);
char *vdata = (char *) alloca (sizeof "DISPLAY=" + SBYTES (display));
strcpy (vdata, "DISPLAY=");
strcat (vdata, SSDATA (display));
new_env = add_env (env, new_env, vdata);
......
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