summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-12-18 23:33:10 +0000
committerVaxry <vaxry@vaxry.net>2023-12-18 23:33:10 +0000
commitef445093f9fbd9a41a91914ef45e6499b3afa54d (patch)
tree18be8e91584106ea822ff9a98164a2e0caa159fb /src
parent11fd37418c8520d9e9ac49856502d1f7d67fae08 (diff)
internal: convert uname fields to strings before logging
fixes #4188, thanks @jbeich
Diffstat (limited to 'src')
-rw-r--r--src/debug/CrashReporter.cpp4
-rw-r--r--src/helpers/MiscFunctions.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/debug/CrashReporter.cpp b/src/debug/CrashReporter.cpp
index dac96fb3..ff2a5191 100644
--- a/src/debug/CrashReporter.cpp
+++ b/src/debug/CrashReporter.cpp
@@ -63,8 +63,8 @@ void CrashReporter::createAndSaveCrash(int sig) {
struct utsname unameInfo;
uname(&unameInfo);
- finalCrashReport +=
- std::format("\tSystem name: {}\n\tNode name: {}\n\tRelease: {}\n\tVersion: {}\n\n", unameInfo.sysname, unameInfo.nodename, unameInfo.release, unameInfo.version);
+ finalCrashReport += std::format("\tSystem name: {}\n\tNode name: {}\n\tRelease: {}\n\tVersion: {}\n\n", std::string{unameInfo.sysname}, std::string{unameInfo.nodename},
+ std::string{unameInfo.release}, std::string{unameInfo.version});
#if defined(__DragonFly__) || defined(__FreeBSD__)
const std::string GPUINFO = execAndGet("pciconf -lv | fgrep -A4 vga");
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 16650e1b..6eab7e2b 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -577,10 +577,10 @@ void logSystemInfo() {
uname(&unameInfo);
- Debug::log(LOG, "System name: {}", unameInfo.sysname);
- Debug::log(LOG, "Node name: {}", unameInfo.nodename);
- Debug::log(LOG, "Release: {}", unameInfo.release);
- Debug::log(LOG, "Version: {}", unameInfo.version);
+ Debug::log(LOG, "System name: {}", std::string{unameInfo.sysname});
+ Debug::log(LOG, "Node name: {}", std::string{unameInfo.nodename});
+ Debug::log(LOG, "Release: {}", std::string{unameInfo.release});
+ Debug::log(LOG, "Version: {}", std::string{unameInfo.version});
Debug::log(NONE, "\n");