Index: base/applications/network/ftp/cmds.c
===================================================================
--- base/applications/network/ftp/cmds.c	(revision 65860)
+++ base/applications/network/ftp/cmds.c	(working copy)
@@ -1842,10 +1842,10 @@
     char *cp2 = new;
 	register int i, ostop, found;
 
-	for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++);
+	for (ostop = 0; ostop < 16 && *(ntout + ostop); ostop++);
 	for (cp1 = name; *cp1; cp1++) {
 		found = 0;
-		for (i = 0; *(ntin + i) && i < 16; i++) {
+		for (i = 0; i < 16 && *(ntin + i); i++) {
 			if (*cp1 == *(ntin + i)) {
 				found++;
 				if (i < ostop) {
Index: base/applications/notepad/dialog.c
===================================================================
--- base/applications/notepad/dialog.c	(revision 65860)
+++ base/applications/notepad/dialog.c	(working copy)
@@ -1025,7 +1025,7 @@
     SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM) &dwStart, (LPARAM) &dwEnd);
 
     nLine = 1;
-    for (i = 0; pszText[i] && (i < (int) dwStart); i++)
+    for (i = 0; (i < (int) dwStart) && pszText[i]; i++)
     {
         if (pszText[i] == '\n')
             nLine++;
Index: base/applications/wordpad/registry.c
===================================================================
--- base/applications/wordpad/registry.c	(revision 65860)
+++ base/applications/wordpad/registry.c	(working copy)
@@ -295,12 +295,12 @@
 
         if(lstrcmpiW(newFile, pFiles[0]))
         {
-            for(i = 0; pFiles[i] && i < FILELIST_ENTRIES; i++)
+            for(i = 0; i < FILELIST_ENTRIES && pFiles[i]; i++)
             {
                 if(!lstrcmpiW(pFiles[i], newFile))
                 {
                     int j;
-                    for(j = 0; pFiles[j] && j < i; j++)
+                    for(j = 0; j < i && pFiles[j]; j++)
                     {
                         pFiles[i-j] = pFiles[i-j-1];
                     }
@@ -320,7 +320,7 @@
                 pFiles[0] = newFile;
             }
 
-            for(i = 0; pFiles[i] && i < FILELIST_ENTRIES; i++)
+            for(i = 0; i < FILELIST_ENTRIES && pFiles[i]; i++)
             {
                 wsprintfW(buffer, var_file, i+1);
                 RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (const BYTE*)pFiles[i],
Index: dll/win32/netapi32/nbt.c
===================================================================
--- dll/win32/netapi32/nbt.c	(revision 65860)
+++ dll/win32/netapi32/nbt.c	(working copy)
@@ -163,7 +163,7 @@
     if (!buffer) return 0;
 
     buffer[len++] = NCBNAMSZ * 2;
-    for (i = 0; p[i] && i < NCBNAMSZ; i++)
+    for (i = 0; i < NCBNAMSZ && p[i]; i++)
     {
         buffer[len++] = ((p[i] & 0xf0) >> 4) + 'A';
         buffer[len++] =  (p[i] & 0x0f) + 'A';
Index: dll/win32/usp10/shape.c
===================================================================
--- dll/win32/usp10/shape.c	(revision 65860)
+++ dll/win32/usp10/shape.c	(working copy)
@@ -1581,7 +1581,7 @@
     cWalk=cWalk+1;
 
     /* Insert */
-    for (i = 1; replacements[i] != 0x0000 && i < 3; i++)
+    for (i = 1; i < 3 && replacements[i] != 0x0000; i++)
     {
         int j;
         for (j = *pcChars; j > cWalk; j--)
Index: dll/win32/winhttp/handle.c
===================================================================
--- dll/win32/winhttp/handle.c	(revision 65860)
+++ dll/win32/winhttp/handle.c	(working copy)
@@ -100,7 +100,7 @@
     if (handles[handle]) ERR("handle isn't free but should be\n");
 
     handles[handle] = addref_object( hdr );
-    while (handles[next_handle] && (next_handle < max_handles)) next_handle++;
+    while ((next_handle < max_handles) && handles[next_handle]) next_handle++;
 
 end:
     LeaveCriticalSection( &handle_cs );
Index: dll/win32/wininet/internet.c
===================================================================
--- dll/win32/wininet/internet.c	(revision 65860)
+++ dll/win32/wininet/internet.c	(working copy)
@@ -115,7 +115,7 @@
         handle_table[handle] = ret;
         ret->valid_handle = TRUE;
 
-        while(handle_table[next_handle] && next_handle < handle_table_size)
+        while(next_handle < handle_table_size && handle_table[next_handle])
             next_handle++;
     }
 
Index: lib/drivers/lwip/src/core/dhcp.c
===================================================================
--- lib/drivers/lwip/src/core/dhcp.c	(revision 65860)
+++ lib/drivers/lwip/src/core/dhcp.c	(working copy)
@@ -1377,7 +1377,7 @@
   offset_max = options_idx_max;
   options = (u8_t*)q->payload;
   /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
-  while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
+  while((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) {
     u8_t op = options[offset];
     u8_t len;
     u8_t decode_len = 0;
Index: win32ss/user/user32/controls/edit.c
===================================================================
--- win32ss/user/user32/controls/edit.c	(revision 65860)
+++ win32ss/user/user32/controls/edit.c	(working copy)
@@ -292,7 +292,7 @@
     case WB_RIGHT:
         if (!count)
             break;
-        while (s[index] && index < count && !es->logAttr[index].fSoftBreak)
+        while (index < count && s[index] && !es->logAttr[index].fSoftBreak)
             index++;
         ret = index;
         break;
