8e2a8efd84
This PR simply checks the status before writing the header. Signed-off-by: Andrew Thornton <art27@cantab.net>