[EXPLORER]
[reactos.git] / reactos / base / shell / explorer / shell / pane.cpp
index d28f907..0273fb6 100644 (file)
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 
@@ -702,7 +702,10 @@ void Pane::set_header()
        item.mask = HDI_WIDTH;
        item.cxy = 0;
 
-       for(; x+_widths[i]<scroll_pos && i<COLUMNS; i++) {
+       for(; i<COLUMNS; i++) {
+               if (x + _widths[i] >= scroll_pos)
+                       break;
+
                x += _widths[i];
                Header_SetItem(_hwndHeader, i, &item);
        }