summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-09-02 21:38:51 -0700
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-05 13:44:21 +0200
commit7f92d00164330af5816e96ad964daf718d8d78c4 (patch)
tree58ae20622676b188c291cae28b838a185dce3b52 /tests
parent925900e66156e943f2418b1c7702bd16d41e348b (diff)
Use PATH_MAX to fix some sprintf-into-short-buffers warnings.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_hdmi_inject.c2
-rw-r--r--tests/pm_rpm.c4
2 files changed, 3 insertions, 3 deletions
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))