fwrite fix + rebased to master
Merge pull request #39 from Cinderella-Man/fwrite-optimizer-TSRMLS_CC-fix

fwrite fix