summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack/usb_storage.c
diff options
context:
space:
mode:
authorRafaël Carré <funman@videolan.org>2012-05-07 12:54:11 -0400
committerRafaël Carré <funman@videolan.org>2012-05-07 12:54:11 -0400
commitdae7a29b35db0ac4911007180389cdc0e98d5af5 (patch)
tree9e291c6462c3af3cc796af7989278f4eb3f7cd34 /firmware/usbstack/usb_storage.c
parent7803f31c531c75c75d57513caa14caa934edcf19 (diff)
downloadrockbox-dae7a29b35db0ac4911007180389cdc0e98d5af5.tar.gz
rockbox-dae7a29b35db0ac4911007180389cdc0e98d5af5.tar.bz2
rockbox-dae7a29b35db0ac4911007180389cdc0e98d5af5.zip
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.
Diffstat (limited to 'firmware/usbstack/usb_storage.c')
-rw-r--r--firmware/usbstack/usb_storage.c2
1 files changed, 1 insertions, 1 deletions
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;
}