]> 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 526d4c3610b48f2907e3fa8e4f5fd5b9c8d6af3f..cd4f9ce57fa9d5aa008cf492399b73b3d10ac5bc 100644 (file)
@@ -1,7 +1,7 @@
 /* Session management module for systems which understand the X Session
    management protocol.
 
-Copyright (C) 2002-2013 Free Software Foundation, Inc.
+Copyright (C) 2002-2014 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -49,7 +49,7 @@ static struct input_event emacs_event;
 
 /* The descriptor that we use to check for data from the session manager.  */
 
-static int ice_fd;
+static int ice_fd = -1;
 
 /* A flag that says if we are in shutdown interactions or not.  */
 
@@ -395,7 +395,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
 {
 #define SM_ERRORSTRING_LEN 512
   char errorstring[SM_ERRORSTRING_LEN];
-  charprevious_id = NULL;
+  char *previous_id = NULL;
   SmcCallbacks callbacks;
   ptrdiff_t name_len = 0;
 
@@ -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))
-    strcpy (emacs_program, SSDATA (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.  */