dtstyle: Coverity 88726
authorPeter Howkins <flibble@users.sf.net>
Tue, 3 Jul 2018 17:45:31 +0000 (18:45 +0100)
committerPeter Howkins <flibble@users.sf.net>
Tue, 3 Jul 2018 17:45:31 +0000 (18:45 +0100)
cde/programs/dtstyle/ColorMain.c

index bcb223b1542d11ddeeb910f85557873c23b5f7d8..811c6c725b1d5e7de40432325e837c7ac4ba5d10 100644 (file)
@@ -851,9 +851,10 @@ selectPaletteCB(
        selected_position = cb->item_position;
 
        tmp_palette = pHeadPalette;
-       while( tmp_palette->item_position != selected_position &&
-                                                 tmp_palette != NULL)
+       while( tmp_palette != NULL &&
+              tmp_palette->item_position != selected_position ) {
             tmp_palette = tmp_palette->next;
+       }
 
        if(tmp_palette->item_position == selected_position)
        {