Thread (20 messages) 20 messages, 4 authors, 2013-03-10
STALE4839d

[PATCH] drivers/tty/hvc: fixup original commit: 9276dfd27897a0b29d8b5814f39a1f82f56b6b6b

From: Chen Gang <hidden>
Date: 2013-03-08 03:38:51
Subsystem: hypervisor virtual console driver, the rest, tty layer and serial drivers · Maintainers: Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby

  originally I did not notice src buf len and dest buf len are the same.
    so origianlly, it is not a bug issue, it is only for beautify code.
    and now, using strcpy is better.


Signed-off-by: Chen Gang <redacted>
Signed-off-by: Jiri Slaby <redacted>
---
 drivers/tty/hvc/hvcs.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 81e939e..9330a4b 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -885,8 +885,7 @@ static void hvcs_set_pi(struct hvcs_partner_info
*pi, struct hvcs_struct *hvcsd)
 	hvcsd->p_partition_ID  = pi->partition_ID;

 	/* copy the null-term char too */
-	strlcpy(&hvcsd->p_location_code[0],
-			&pi->location_code[0], sizeof(hvcsd->p_location_code));
+	strcpy(&hvcsd->p_location_code[0], &pi->location_code[0]);
 }

 /*
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help