summaryrefslogtreecommitdiff
path: root/android/hardware/hardware.c
diff options
context:
space:
mode:
Diffstat (limited to 'android/hardware/hardware.c')
-rw-r--r--android/hardware/hardware.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/android/hardware/hardware.c b/android/hardware/hardware.c
index 4bd5eba5d..3a45fe1f1 100644
--- a/android/hardware/hardware.c
+++ b/android/hardware/hardware.c
@@ -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