android: Fix some compilation warnings 17/205017/1
authorSzymon Janc <szymon.janc@codecoup.pl>
Fri, 25 May 2018 11:24:50 +0000 (13:24 +0200)
committerAmit Purwar <amit.purwar@samsung.com>
Mon, 29 Apr 2019 04:12:27 +0000 (09:42 +0530)
Change-Id: I92c2d127077f482875ea05b52e32e64163f1b2e3
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
android/hardware/hardware.c
android/ipc-tester.c
android/tester-main.c

index 4bd5eba..3a45fe1 100755 (executable)
@@ -100,12 +100,12 @@ int hw_get_module_by_class(const char *class_id, const char *inst,
                            const struct hw_module_t **module)
 {
     char path[PATH_MAX];
-    char name[PATH_MAX];
+    char name[PATH_MAX/2];
 
     if (inst)
-        snprintf(name, PATH_MAX, "%s.%s", class_id, inst);
+        snprintf(name, sizeof(name), "%s.%s", class_id, inst);
     else
-        snprintf(name, PATH_MAX, "%s", class_id);
+        snprintf(name, sizeof(name), "%s", class_id);
 
     /*
      * Here we rely on the fact that calling dlopen multiple times on
index 1aa17d2..3b7f13a 100755 (executable)
@@ -218,7 +218,7 @@ static void test_post_teardown(const void *data)
 
 static void bluetoothd_start(int hci_index)
 {
-       char prg_name[PATH_MAX];
+       char prg_name[PATH_MAX + 11];
        char index[8];
        char *prg_argv[4];
 
index e9b1353..8d9add9 100755 (executable)
@@ -253,7 +253,7 @@ static void test_post_teardown(const void *test_data)
 
 static void bluetoothd_start(int hci_index)
 {
-       char prg_name[PATH_MAX + 1];
+       char prg_name[PATH_MAX + 1 + 11];
        char index[8];
        char *prg_argv[5];