aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/hvc/hvcs.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 1956593ee89..81e939e90c4 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -881,17 +881,12 @@ static struct vio_driver hvcs_vio_driver = {
881/* Only called from hvcs_get_pi please */ 881/* Only called from hvcs_get_pi please */
882static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd) 882static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd)
883{ 883{
884 int clclength;
885
886 hvcsd->p_unit_address = pi->unit_address; 884 hvcsd->p_unit_address = pi->unit_address;
887 hvcsd->p_partition_ID = pi->partition_ID; 885 hvcsd->p_partition_ID = pi->partition_ID;
888 clclength = strlen(&pi->location_code[0]);
889 if (clclength > HVCS_CLC_LENGTH)
890 clclength = HVCS_CLC_LENGTH;
891 886
892 /* copy the null-term char too */ 887 /* copy the null-term char too */
893 strncpy(&hvcsd->p_location_code[0], 888 strlcpy(&hvcsd->p_location_code[0],
894 &pi->location_code[0], clclength + 1); 889 &pi->location_code[0], sizeof(hvcsd->p_location_code));
895} 890}
896 891
897/* 892/*