mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-26 21:54:37 +08:00
usb: fsl: Fix NULL terminating issue for usb controller name string
Fixes NULL terminating issue for usb controller name string by using sizeof operator. Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
This commit is contained in:
parent
b66a5c03a0
commit
217d16973d
@ -65,7 +65,8 @@ int ehci_hcd_init(int index, enum usb_init_type init,
|
||||
mdelay(5);
|
||||
}
|
||||
memset(current_usb_controller, '\0', 5);
|
||||
snprintf(current_usb_controller, 4, "usb%d", index+1);
|
||||
snprintf(current_usb_controller, sizeof(current_usb_controller),
|
||||
"usb%d", index+1);
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
Loading…
Reference in New Issue
Block a user