summaryrefslogtreecommitdiff
path: root/src/xsmfns.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-09-23 21:12:37 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-09-23 21:12:37 -0700
commit4620e6bccd98625208d8be4d960d24119a20594f (patch)
tree6de4ba8eba559a7b844b177e336cbd012fedd22d /src/xsmfns.c
parent7d760fd8f4fd2fb622183106912c34845e280333 (diff)
downloademacs-4620e6bccd98625208d8be4d960d24119a20594f.tar.gz
Fix some slow uses and misuses of strcat.
* doc.c (get_doc_string): * gtkutil.c (get_utf8_string): * xsmfns.c (x_session_initialize): Avoid recomputation of string length. * ftfont.c (ftfont_spec_pattern): * xfns.c (xic_create_fontsetname): Don't assume output buffer is initially zero.
Diffstat (limited to 'src/xsmfns.c')
-rw-r--r--src/xsmfns.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xsmfns.c b/src/xsmfns.c
index ed67a7d8e1f..cd4f9ce57fa 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -415,11 +415,11 @@ x_session_initialize (struct x_display_info *dpyinfo)
/* This malloc will not be freed, but it is only done once, and hopefully
not very large */
emacs_program = xmalloc (name_len + 1);
- emacs_program[0] = '\0';
+ char *z = emacs_program;
if (! EQ (Vinvocation_directory, Qnil))
- lispstpcpy (emacs_program, Vinvocation_directory);
- strcat (emacs_program, SSDATA (Vinvocation_name));
+ z = lispstpcpy (z, Vinvocation_directory);
+ lispstpcpy (z, Vinvocation_name);
/* The SM protocol says all callbacks are mandatory, so set up all
here and in the mask passed to SmcOpenConnection. */