all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11375: [PATCH] simplify/clarify xfns.c, replacing 4 lines with one
@ 2012-04-28 22:02 Jim Meyering
  2012-05-02 10:20 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Meyering @ 2012-04-28 22:02 UTC (permalink / raw)
  To: 11375


2012-04-28  Jim Meyering  <meyering@redhat.com>

	simplify/clarify xfns.c, replacing 4 lines with one
	* src/xfns.c (x_window): Replace strlen+xmalloc+strncpy with xstrdup.

---
 src/xfns.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/xfns.c b/src/xfns.c
index 6f08ada..f7a80ce 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2439,7 +2439,6 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)

   /* Do some needed geometry management.  */
   {
-    ptrdiff_t len;
     char *tem, shell_position[sizeof "=x++" + 4 * INT_STRLEN_BOUND (int)];
     Arg gal[10];
     int gac = 0;
@@ -2508,13 +2507,11 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
         }
     }

-    len = strlen (shell_position) + 1;
     /* We don't free this because we don't know whether
        it is safe to free it while the frame exists.
        It isn't worth the trouble of arranging to free it
        when the frame is deleted.  */
-    tem = (char *) xmalloc (len);
-    strncpy (tem, shell_position, len);
+    tem = (char *) xstrdup (shell_position);
     XtSetArg (gal[gac], XtNgeometry, tem); gac++;
     XtSetValues (shell_widget, gal, gac);
   }
--
1.7.10.382.g62bc8





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#11375: [PATCH] simplify/clarify xfns.c, replacing 4 lines with one
  2012-04-28 22:02 bug#11375: [PATCH] simplify/clarify xfns.c, replacing 4 lines with one Jim Meyering
@ 2012-05-02 10:20 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-05-02 10:20 UTC (permalink / raw)
  To: Jim Meyering; +Cc: 11375

Jim Meyering <jim@meyering.net> writes:

> 2012-04-28  Jim Meyering  <meyering@redhat.com>
>
> 	simplify/clarify xfns.c, replacing 4 lines with one
> 	* src/xfns.c (x_window): Replace strlen+xmalloc+strncpy with xstrdup.

Thanks, committed to trunk.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-02 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-28 22:02 bug#11375: [PATCH] simplify/clarify xfns.c, replacing 4 lines with one Jim Meyering
2012-05-02 10:20 ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.