fixed a mistake in the fwrite usage

Signed-off-by: Tal Kain <tal.kain@ravellosystems.com>