From 133ce3657061fa0f821c72731419c4dddbd60211 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sat, 7 Sep 2024 08:29:00 +0000 Subject: [PATCH] Fixed goto warning. --- src/core/download_store.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/download_store.cc b/src/core/download_store.cc index a67c0493..0c151db3 100644 --- a/src/core/download_store.cc +++ b/src/core/download_store.cc @@ -101,6 +101,7 @@ DownloadStore::set_path(const std::string& path) { bool DownloadStore::write_bencode(const std::string& filename, const torrent::Object& obj, uint32_t skip_mask) { + int fd; torrent::Object tmp; std::fstream output(filename.c_str(), std::ios::out | std::ios::trunc); @@ -124,7 +125,7 @@ DownloadStore::write_bencode(const std::string& filename, const torrent::Object& output.close(); // Ensure that the new file is actually written to the disk - int fd = ::open(filename.c_str(), O_WRONLY); + fd = ::open(filename.c_str(), O_WRONLY); if (fd < 0) goto download_store_save_error;