diff options
| author | Jim Meyering | 2012-05-02 18:20:35 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-05-02 18:20:35 +0800 |
| commit | c7b8541ee7840221973a2b3908d5535c1d32598b (patch) | |
| tree | 3070cf9c439a0d5f5204f0298a687f3bf2a85f84 /src | |
| parent | 3f83ace8490fef379df303d1d7a86b099329f018 (diff) | |
| download | emacs-c7b8541ee7840221973a2b3908d5535c1d32598b.tar.gz emacs-c7b8541ee7840221973a2b3908d5535c1d32598b.zip | |
* src/xfns.c (x_window): Use xstrdup (Bug#11375).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/xfns.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 33d95c6c7c6..d621dcc8859 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373). | 3 | * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373). |
| 4 | 4 | ||
| 5 | * xfns.c (x_window): Use xstrdup (Bug#11375). | ||
| 6 | |||
| 5 | 2012-05-02 Eli Zaretskii <eliz@gnu.org> | 7 | 2012-05-02 Eli Zaretskii <eliz@gnu.org> |
| 6 | 8 | ||
| 7 | * xdisp.c (pos_visible_p): If already at a newline from the | 9 | * xdisp.c (pos_visible_p): If already at a newline from the |
diff --git a/src/xfns.c b/src/xfns.c index df1b39b018f..510a66d6349 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2439,7 +2439,6 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) | |||
| 2439 | 2439 | ||
| 2440 | /* Do some needed geometry management. */ | 2440 | /* Do some needed geometry management. */ |
| 2441 | { | 2441 | { |
| 2442 | ptrdiff_t len; | ||
| 2443 | char *tem, shell_position[sizeof "=x++" + 4 * INT_STRLEN_BOUND (int)]; | 2442 | char *tem, shell_position[sizeof "=x++" + 4 * INT_STRLEN_BOUND (int)]; |
| 2444 | Arg gal[10]; | 2443 | Arg gal[10]; |
| 2445 | int gac = 0; | 2444 | int gac = 0; |
| @@ -2508,13 +2507,11 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) | |||
| 2508 | } | 2507 | } |
| 2509 | } | 2508 | } |
| 2510 | 2509 | ||
| 2511 | len = strlen (shell_position) + 1; | ||
| 2512 | /* We don't free this because we don't know whether | 2510 | /* We don't free this because we don't know whether |
| 2513 | it is safe to free it while the frame exists. | 2511 | it is safe to free it while the frame exists. |
| 2514 | It isn't worth the trouble of arranging to free it | 2512 | It isn't worth the trouble of arranging to free it |
| 2515 | when the frame is deleted. */ | 2513 | when the frame is deleted. */ |
| 2516 | tem = (char *) xmalloc (len); | 2514 | tem = (char *) xstrdup (shell_position); |
| 2517 | strncpy (tem, shell_position, len); | ||
| 2518 | XtSetArg (gal[gac], XtNgeometry, tem); gac++; | 2515 | XtSetArg (gal[gac], XtNgeometry, tem); gac++; |
| 2519 | XtSetValues (shell_widget, gal, gac); | 2516 | XtSetValues (shell_widget, gal, gac); |
| 2520 | } | 2517 | } |