]> code.delx.au - gnu-emacs/blobdiff - src/xsmfns.c
Merge from emacs-24; up to 2014-07-27T01:00:26Z!fgallina@gnu.org
[gnu-emacs] / src / xsmfns.c
index ed67a7d8e1fe8b097e5b5e5e0261754edb93d6ad..cd4f9ce57fa9d5aa008cf492399b73b3d10ac5bc 100644 (file)
@@ -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.  */