From: kink Date: Tue, 11 Mar 2003 09:02:13 +0000 (+0000) Subject: fwrite returns 0 when 0 bytes written, so use === FALSE test instead. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=491696a82ef78b134758fc56089d25fc3f70edff;p=squirrelmail.git fwrite returns 0 when 0 bytes written, so use === FALSE test instead. Thanks Jon for the tip. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4639 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/file_prefs.php b/functions/file_prefs.php index d80ba438..ed2face7 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -73,8 +73,8 @@ function cachePrefValues($data_dir, $username) { $prefs_cache[$key] = $value; } } - } - fclose($file); + } + fclose($file); $prefs_are_cached = TRUE; @@ -119,7 +119,7 @@ function savePrefValues($data_dir, $username) { } foreach ($prefs_cache as $Key => $Value) { if (isset($Value)) { - if ( ! @fwrite($file, $Key . '=' . $Value . "\n") ) { + if ( @fwrite($file, $Key . '=' . $Value . "\n") === FALSE ) { logout_error( sprintf( _("Preference file, %s, could not be written. Contact your system administrator to resolve this issue.") , $filename . '.tmp') ); exit; } @@ -222,7 +222,7 @@ function setSig($data_dir, $username, $number, $value) { logout_error( sprintf( _("Signature file, %s, could not be opened. Contact your system administrator to resolve this issue."), $filename . '.tmp') ); exit; } - if (! @fwrite($file, $value) ) { + if ( @fwrite($file, $value) === FALSE ) { logout_error( sprintf( _("Signature file, %s, could not be written. Contact your system administrator to resolve this issue.") , $filename . '.tmp')); exit; }