Index: uc_restrict_qty.module
===================================================================
--- uc_restrict_qty.module	(revision 3297)
+++ uc_restrict_qty.module	(working copy)
@@ -126,7 +126,8 @@
 function uc_restrict_qty_form_alter(&$form, &$form_state, $form_id) {
   // Disable the appropriate Qty. fields on the cart view form.
   if ($form_id == 'uc_cart_view_form') {
-    for ($i = 0, $j = count(uc_cart_get_contents()); $i < $j; $i++) {
+    $total = count(uc_cart_get_contents());
+    for ($i = 0, $j = $total; $i < $j; $i++) {
       $data = unserialize($form['items'][$i]['data']['#value']);
 
       // If this item has a quantity restriction on it...

