From 34c7ca0cf666aff5ab88a1ec6caedc838e4015fd Mon Sep 17 00:00:00 2001 From: Mishmish Dev Date: Sun, 4 Oct 2026 03:57:42 +0100 Subject: [PATCH] Initialize the file pointer when constructing a buffer writer --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index c8c69267..c9ae6eaf 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1091,7 +1091,7 @@ class writer { public: inline writer(FILE* f) : buf_(nullptr), file_(f) {} - inline writer(detail::buffer& buf) : buf_(&buf) {} + inline writer(detail::buffer& buf) : buf_(&buf), file_(nullptr) {} /// Formats `args` according to specifications in `fmt` and writes the /// output to the file.