Explicit convert from std::string to const char*

This commit is contained in:
Nicola Revelant 2024-03-15 16:52:52 +01:00
parent e1f876b981
commit fbf66530a3
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ float waybar::modules::Temperature::getTemperature() {
auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0; auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0;
if (sysctlbyname(fmt::format("hw.acpi.thermal.tz{}.temperature", zone), &temp, &size, NULL, 0) != 0) { if (sysctlbyname(fmt::format("hw.acpi.thermal.tz{}.temperature", zone).c_str(), &temp, &size, NULL, 0) != 0) {
throw std::runtime_error( throw std::runtime_error(
fmt::format("sysctl hw.acpi.thermal.tz{}.temperature or dev.cpu.{}.temperature failed", zone, zone)); fmt::format("sysctl hw.acpi.thermal.tz{}.temperature or dev.cpu.{}.temperature failed", zone, zone));
} }