X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fstrings.php;h=e295c4c910581e81d4f37e7384ebfed934bccb33;hp=01454742ee109a5458f277fae3ba9b3e0fb07227;hb=3ecad5e6d4b425f935cbb53d460cd627a9db2f17;hpb=af5a3d8971cb16986b7dd344c817c3747fd43d07 diff --git a/functions/strings.php b/functions/strings.php index 01454742..e295c4c9 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -541,5 +541,21 @@ function sm_print_r() { print ''; } +/** + * version of fwrite which checks for failure + */ +function sq_fwrite($fp, $string) { + // write to file + $count = @fwrite($fp,$string); + // the number of bytes written should be the length of the string + if($count != strlen($string)) { + return FALSE; + } + + return $count; +} + + + $PHP_SELF = php_self(); ?>