Fix a potential undefined variable error
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 8cfe0f1..8fdb5f7 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -80,7 +80,7 @@
flock($fp, LOCK_EX);
- for ($written = 0, $length = strlen($data); $written < $length; $written += $result)
+ for ($result = $written = 0, $length = strlen($data); $written < $length; $written += $result)
{
if (($result = fwrite($fp, substr($data, $written))) === FALSE)
{
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index ab30a90..62a84ae 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -405,7 +405,7 @@
flock($fp, LOCK_EX);
- for ($written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result)
+ for ($result = $written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result)
{
if (($result = fwrite($fp, substr($data, $written))) === FALSE)
{