From dae7a29b35db0ac4911007180389cdc0e98d5af5 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Mon, 7 May 2012 12:54:11 -0400 Subject: fix a mistake of 803408f18 spotted by n1s When the source string terminates (with a 0) we pad the rest of the destination with spaces. --- firmware/usbstack/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index c1f278b0ff..b7fdeac7e2 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -1218,7 +1218,7 @@ static void send_csw(int status) static void copy_padded(char *dest, char *src, int len) { for (int i = 0; i < len; i++) { - if (src[i] != 0) { + if (src[i] == '\0') { memset(&dest[i], ' ', len - i); return; } -- cgit v1.2.3