power: Ensure node_path is a string literal
authorChristopher N. Hesse <raymanfx@gmail.com>
Mon, 1 Feb 2016 11:36:54 +0000 (12:36 +0100)
committerChristopher N. Hesse <raymanfx@gmail.com>
Mon, 1 Feb 2016 11:36:54 +0000 (12:36 +0100)
Change-Id: I20a87b04789e7fe2ae5938331e9d2fcef8134035

power/power.c

index 0b939b871d75b215f43b160473df9403ee8243a0..5a0b116a95ea1882b28ec8f03e06b377af95b019 100644 (file)
@@ -183,7 +183,8 @@ static void find_input_nodes(struct samsung_power_module *samsung_pwr, char *dir
                     ALOGE("Out of memory: %s\n", errno_str);
                     return;
                 }
-                snprintf(samsung_pwr->touchkey_power_path, node_pathsize, node_path);
+                snprintf(samsung_pwr->touchkey_power_path, node_pathsize,
+                         "%s", node_path);
             }
 
             if (strncmp(file_content, "sec_touchscreen", 15) == 0) {
@@ -194,7 +195,8 @@ static void find_input_nodes(struct samsung_power_module *samsung_pwr, char *dir
                     ALOGE("Out of memory: %s\n", errno_str);
                     return;
                 }
-                snprintf(samsung_pwr->touchscreen_power_path, node_pathsize, node_path);
+                snprintf(samsung_pwr->touchscreen_power_path, node_pathsize,
+                         "%s", node_path);
             }
         }
     }