From ceaf7bc52712cb60708ed5eb5c62c5e463dd8e89 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Jan 2021 04:15:26 +0100 Subject: Tidying. --- src/data.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/data.cc') diff --git a/src/data.cc b/src/data.cc index 23e62573..79f58f93 100644 --- a/src/data.cc +++ b/src/data.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2015-2020 Carl Hetherington + Copyright (C) 2015-2021 Carl Hetherington This file is part of libdcp. @@ -32,9 +32,14 @@ */ +/** @file src/data.cc + * @brief Data class + */ + + #include "data.h" -#include "util.h" #include "exceptions.h" +#include "util.h" #include #include @@ -45,16 +50,15 @@ using namespace dcp; void Data::write (boost::filesystem::path file) const { - FILE* f = fopen_boost (file, "wb"); + auto f = fopen_boost (file, "wb"); if (!f) { throw FileError ("could not write to file", file, errno); } size_t const r = fwrite (data(), 1, size(), f); + fclose (f); if (r != size_t(size())) { - fclose (f); throw FileError ("could not write to file", file, errno); } - fclose (f); } -- cgit v1.2.3