From 35016e9a4e2fe3b60cbadd94a1a2feaed8aa1484 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Jun 2011 11:40:02 -0700 Subject: [PATCH] * callproc.c (child_setup): Rewrite to avoid two strlen calls. --- src/ChangeLog | 2 ++ src/callproc.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b843dfc6965..bcf40a4e470 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-06-19 Paul Eggert + * 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. diff --git a/src/callproc.c b/src/callproc.c index fae47b7a699..12621c90db5 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -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); -- 2.39.2