aboutsummaryrefslogtreecommitdiffstats
path: root/src/xsmfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xsmfns.c')
-rw-r--r--src/xsmfns.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xsmfns.c b/src/xsmfns.c
index cb56ae648d1..1f6eb84260e 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -1,7 +1,7 @@
1/* Session management module for systems which understand the X Session 1/* Session management module for systems which understand the X Session
2 management protocol. 2 management protocol.
3 3
4Copyright (C) 2002-2011 Free Software Foundation, Inc. 4Copyright (C) 2002-2012 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -223,9 +223,11 @@ smc_save_yourself_CB (SmcConn smcConn,
223 props[props_idx]->name = xstrdup (SmRestartCommand); 223 props[props_idx]->name = xstrdup (SmRestartCommand);
224 props[props_idx]->type = xstrdup (SmLISTofARRAY8); 224 props[props_idx]->type = xstrdup (SmLISTofARRAY8);
225 /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir ... */ 225 /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir ... */
226 if (INT_MAX - 3 < initial_argc)
227 memory_full (SIZE_MAX);
226 i = 3 + initial_argc; 228 i = 3 + initial_argc;
227 props[props_idx]->num_vals = i; 229 props[props_idx]->num_vals = i;
228 vp = (SmPropValue *) xmalloc (i * sizeof(*vp)); 230 vp = xnmalloc (i, sizeof *vp);
229 props[props_idx]->vals = vp; 231 props[props_idx]->vals = vp;
230 props[props_idx]->vals[vp_idx].length = strlen (emacs_program); 232 props[props_idx]->vals[vp_idx].length = strlen (emacs_program);
231 props[props_idx]->vals[vp_idx++].value = emacs_program; 233 props[props_idx]->vals[vp_idx++].value = emacs_program;
@@ -460,7 +462,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
460 Vx_session_id = build_string (client_id); 462 Vx_session_id = build_string (client_id);
461 463
462#ifdef USE_GTK 464#ifdef USE_GTK
463 /* GTK creats a leader window by itself, but we need to tell 465 /* GTK creates a leader window by itself, but we need to tell
464 it about our client_id. */ 466 it about our client_id. */
465 gdk_x11_set_sm_client_id (client_id); 467 gdk_x11_set_sm_client_id (client_id);
466#else 468#else