all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11373: [PATCH] xterm.c: Use memcpy in place of unwarranted strncpy.
@ 2012-04-28 21:58 Jim Meyering
  2012-05-02 10:17 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Meyering @ 2012-04-28 21:58 UTC (permalink / raw)
  To: 11373

There's no reason to use strncpy here, and using it is misleading.

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

	* xterm.c (x_term_init): Use memcpy in place of unwarranted strncpy.

---
 src/ChangeLog |    4 ++++
 src/xterm.c   |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 2792901..6ec58f9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2012-04-26  Jim Meyering  <meyering@redhat.com>
+
+	* xterm.c (x_term_init): Use memcpy in place of unwarranted strncpy.
+
 2012-04-24  Chong Yidong  <cyd@gnu.org>

 	* xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
diff --git a/src/xterm.c b/src/xterm.c
index 9ce1668..2922b05 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10146,7 +10146,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)

   /* Set the name of the terminal. */
   terminal->name = (char *) xmalloc (SBYTES (display_name) + 1);
-  strncpy (terminal->name, SSDATA (display_name), SBYTES (display_name));
+  memcpy (terminal->name, SSDATA (display_name), SBYTES (display_name));
   terminal->name[SBYTES (display_name)] = 0;

 #if 0
--
1.7.10.382.g62bc8





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

* bug#11373: [PATCH] xterm.c: Use memcpy in place of unwarranted strncpy.
  2012-04-28 21:58 bug#11373: [PATCH] xterm.c: Use memcpy in place of unwarranted strncpy Jim Meyering
@ 2012-05-02 10:17 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-05-02 10:17 UTC (permalink / raw)
  To: Jim Meyering; +Cc: 11373

Jim Meyering <jim@meyering.net> writes:

> There's no reason to use strncpy here, and using it is misleading.
>
> 2012-04-28  Jim Meyering  <meyering@redhat.com>
>
> 	* xterm.c (x_term_init): Use memcpy in place of unwarranted strncpy.

Fine, committed to trunk.





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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-28 21:58 bug#11373: [PATCH] xterm.c: Use memcpy in place of unwarranted strncpy Jim Meyering
2012-05-02 10:17 ` 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.