From 7f92d00164330af5816e96ad964daf718d8d78c4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 2 Sep 2017 21:38:51 -0700 Subject: Use PATH_MAX to fix some sprintf-into-short-buffers warnings. Signed-off-by: Eric Anholt Signed-off-by: Daniel Vetter --- tests/kms_hdmi_inject.c | 2 +- tests/pm_rpm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c index cb916ace..22570a4b 100644 --- a/tests/kms_hdmi_inject.c +++ b/tests/kms_hdmi_inject.c @@ -170,7 +170,7 @@ eld_is_valid(void) continue; while ((snd_hda = readdir(dir))) { - char fpath[128]; + char fpath[PATH_MAX]; if (*snd_hda->d_name == '.' || strstr(snd_hda->d_name, "eld") == 0) diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index 47c9f114..9e8cf79b 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -594,14 +594,14 @@ static int count_i2c_valid_edids(void) DIR *dir; struct dirent *dirent; - char full_name[32]; + char full_name[PATH_MAX]; dir = opendir("/dev/"); igt_assert(dir); while ((dirent = readdir(dir))) { if (strncmp(dirent->d_name, "i2c-", 4) == 0) { - snprintf(full_name, 32, "/dev/%s", dirent->d_name); + sprintf(full_name, "/dev/%s", dirent->d_name); fd = open(full_name, O_RDWR); igt_assert_neq(fd, -1); if (i2c_edid_is_valid(fd)) -- cgit v1.2.3