title: Warning: str_repeat(): Second argument has to be greater than or equal to 0
body: <p>I used this a while back to grab images from something but since I just tried using it again it is giving me this error:</p>
  
  <blockquote>
    <p>Warning: str_repeat(): Second argument has to be greater than or equal to 0 in C:\inetpub\wwwroot\resource_update.php on line 121</p>
  </blockquote>
  
  <p>This is the function for what its referring to so if anyone could help that would be great:</p>
  
  <pre><code>function consoleLogProgressBar($current, $size, $unit = "kb")
  {
  $length = (int)(($current/$size)*100);
  $str = sprintf("\r[%-100s] %3d%% (%2d/%2d%s)", str_repeat("=", $length).($length==100?"":"&gt;"), $length, ($current/($unit=="kb"?1024:1)), $size/($unit=="kb"?1024:1), " ".$unit);
  consoleLog($str, true);
  }
  </code></pre>