prefer std::format over fmt
Now that std::format is implemented we aren't using complex enough fmt
to warrant using it over the std version. Switch to std and remove the
dependency.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib03cdb6a9db4d25de345bdb49b28157880c19bc1
diff --git a/host_check.cpp b/host_check.cpp
index d866085..c3e37c8 100644
--- a/host_check.cpp
+++ b/host_check.cpp
@@ -13,6 +13,7 @@
#include <cstdio>
#include <cstdlib>
+#include <format>
#include <fstream>
#include <iostream>
#include <ranges>
@@ -195,11 +196,8 @@
info("Host is running!");
// Create file for host instance and create in filesystem to
// indicate to services that host is running
- auto size = std::snprintf(nullptr, 0, HOST_RUNNING_FILE, 0);
- size++; // null
- std::unique_ptr<char[]> buf(new char[size]);
- std::snprintf(buf.get(), size, HOST_RUNNING_FILE, 0);
- std::ofstream outfile(buf.get());
+ std::string hostFile = std::format(HOST_RUNNING_FILE, 0);
+ std::ofstream outfile(hostFile);
outfile.close();
return true;
}