Oops, it seems that I've forgot to use sizeof, here is fixed patch:
src/devices/runtime_pm.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/devices/runtime_pm.cpp b/src/devices/runtime_pm.cpp
index ccfd945..26f9d32 100644
--- a/src/devices/runtime_pm.cpp
+++ b/src/devices/runtime_pm.cpp
@@ -194,6 +194,7 @@ static void do_bus(const char *bus)
if (entry->d_name[0] == '.')
continue;
+ snprintf(filename, sizeof(filename), "/sys/bus/%s/devices/%s",
bus, entry->d_name);
dev = new class runtime_pmdevice(entry->d_name, filename);
if (strcmp(bus, "i2c") == 0) {
2016-02-22 17:27 GMT+03:00 Yaroslav Isakov <yaroslav.isakov(a)gmail.com>:
src/devices/runtime_pm.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/devices/runtime_pm.cpp b/src/devices/runtime_pm.cpp
index ccfd945..f387b21 100644
--- a/src/devices/runtime_pm.cpp
+++ b/src/devices/runtime_pm.cpp
@@ -194,6 +194,7 @@ static void do_bus(const char *bus)
if (entry->d_name[0] == '.')
continue;
+ snprintf(filename, PATH_MAX, "/sys/bus/%s/devices/%s", bus,
entry->d_name);
dev = new class runtime_pmdevice(entry->d_name, filename);
if (strcmp(bus, "i2c") == 0) {