summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/usbstack/usb_storage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index 8203ad4177..c5fa47fa51 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -343,7 +343,7 @@ static void yearday_to_daymonth(int yd, int y, int *d, int *m)
t=tnl;
}
- while(yd >= t[i] && i<12)
+ while(i<12 && yd >= t[i])
{
yd-=t[i];
i++;
@@ -1233,7 +1233,7 @@ static void send_csw(int status)
static void copy_padded(char *dest, char *src, int len)
{
int i=0;
- while(src[i]!=0 && i<len)
+ while(i<len && src[i]!=0)
{
dest[i]=src[i];
i++;