[EXPLORER]
[reactos.git] / reactos / base / shell / explorer / shell / pane.cpp
index 1e69b60..0273fb6 100644 (file)
@@ -702,7 +702,10 @@ void Pane::set_header()
        item.mask = HDI_WIDTH;
        item.cxy = 0;
 
-       for(; i<COLUMNS && x+_widths[i]<scroll_pos; i++) {
+       for(; i<COLUMNS; i++) {
+               if (x + _widths[i] >= scroll_pos)
+                       break;
+
                x += _widths[i];
                Header_SetItem(_hwndHeader, i, &item);
        }