From: Peter Howkins Date: Tue, 3 Jul 2018 17:45:31 +0000 (+0100) Subject: dtstyle: Coverity 88726 X-Git-Tag: 2.3.0a~230 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9e0cd3fe515bfc6f85f76a3990dba3fb0645e66c;p=oweals%2Fcde.git dtstyle: Coverity 88726 --- diff --git a/cde/programs/dtstyle/ColorMain.c b/cde/programs/dtstyle/ColorMain.c index bcb223b1..811c6c72 100644 --- a/cde/programs/dtstyle/ColorMain.c +++ b/cde/programs/dtstyle/ColorMain.c @@ -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) {