summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorBen Whitten <ben.whitten@gmail.com>2015-12-30 13:05:58 +0000
committerTom Rini <trini@konsulko.com>2016-01-14 22:11:34 -0500
commit192bc6948b02ff4168cab16162fffb507946dc2b (patch)
treeb49cf85a3fa910182ce7dc2508f00ccb8ade03d4 /drivers/usb/gadget
parent4edde96111aefac63d6aaca6ba87a90d149e973e (diff)
Fix GCC format-security errors and convert sprintfs.
With format-security errors turned on, GCC picks up the use of sprintf with a format parameter not being a string literal. Simple uses of sprintf are also converted to use strcpy. Signed-off-by: Ben Whitten <ben.whitten@gmail.com> Acked-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_fastboot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 20b6c18b9c..87e54ebec7 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -477,7 +477,7 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
req->complete = rx_handler_command;
req->length = EP_BUFFER_SIZE;
- sprintf(response, "OKAY");
+ strcpy(response, "OKAY");
fastboot_tx_write_str(response);
printf("\ndownloading of %d bytes finished\n", download_bytes);
@@ -506,10 +506,10 @@ static void cb_download(struct usb_ep *ep, struct usb_request *req)
printf("Starting download of %d bytes\n", download_size);
if (0 == download_size) {
- sprintf(response, "FAILdata invalid size");
+ strcpy(response, "FAILdata invalid size");
} else if (download_size > CONFIG_FASTBOOT_BUF_SIZE) {
download_size = 0;
- sprintf(response, "FAILdata too large");
+ strcpy(response, "FAILdata too large");
} else {
sprintf(response, "DATA%08x", download_size);
req->complete = rx_handler_dl_image;