diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index e0c16d9e8f..6bd3920587 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -863,7 +863,7 @@ inline int convertJsonToDbus(sd_bus_message* m, const std::string& argType, } else if (argCode.starts_with("(") && argCode.ends_with(")")) { - std::string containedType = argCode.substr(1, argCode.size() - 1); + std::string containedType = argCode.substr(1, argCode.size() - 2); r = sd_bus_message_open_container(m, SD_BUS_TYPE_STRUCT, containedType.c_str()); if (r < 0) @@ -872,7 +872,7 @@ inline int convertJsonToDbus(sd_bus_message* m, const std::string& argType, } nlohmann::json::const_iterator it = j->begin(); - for (const std::string& argCode2 : dbusArgSplit(argType)) + for (const std::string& argCode2 : dbusArgSplit(containedType)) { if (it == j->end()) { @@ -889,7 +889,7 @@ inline int convertJsonToDbus(sd_bus_message* m, const std::string& argType, } else if (argCode.starts_with("{") && argCode.ends_with("}")) { - std::string containedType = argCode.substr(1, argCode.size() - 1); + std::string containedType = argCode.substr(1, argCode.size() - 2); r = sd_bus_message_open_container(m, SD_BUS_TYPE_DICT_ENTRY, containedType.c_str()); if (r < 0) |