public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/3] Use PATH_MAX to fix some sprintf-into-short-buffers warnings.
@ 2017-09-03  4:38 Eric Anholt
  2017-09-03  4:38 ` [PATCH i-g-t 2/3] intel_watermark: Fix a warning about "const char" return being silly Eric Anholt
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Eric Anholt @ 2017-09-03  4:38 UTC (permalink / raw)
  To: intel-gfx

Signed-off-by: Eric Anholt <eric@anholt.net>
---

This little series cleans up many compiler warnings I saw when testing
danvet's meson branch.

 lib/igt_debugfs.c       | 4 ++--
 lib/igt_sysfs.c         | 4 ++--
 tests/kms_hdmi_inject.c | 2 +-
 tests/pm_rpm.c          | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 090b56e03555..63183e57229b 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -491,7 +491,7 @@ static void igt_pipe_crc_reset(int drm_fd)
 	}
 
 	while ((dirent = readdir(dir))) {
-		char buf[128];
+		char buf[PATH_MAX];
 
 		if (strcmp(dirent->d_name, "crtc-") != 0)
 			continue;
@@ -525,7 +525,7 @@ static void igt_pipe_crc_reset(int drm_fd)
 static void pipe_crc_exit_handler(int sig)
 {
 	struct dirent *dirent;
-	char buf[128];
+	char buf[PATH_MAX];
 	DIR *dir;
 	int fd;
 
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 15ed34be0088..9227e374bf44 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -192,7 +192,7 @@ int igt_sysfs_open_parameters(int device)
 	if (params < 0) { /* builtin? */
 		drm_version_t version;
 		char name[32] = "";
-		char path[128];
+		char path[PATH_MAX];
 
 		memset(&version, 0, sizeof(version));
 		version.name_len = sizeof(name);
@@ -499,7 +499,7 @@ void kick_fbcon(bool enable)
 		return;
 
 	while ((de = readdir(dir))) {
-		char buf[128];
+		char buf[PATH_MAX];
 		int fd, len;
 
 		if (strncmp(de->d_name, "vtcon", 5))
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index cb916acec3c1..22570a4b637a 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 47c9f1143484..9e8cf79b5128 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))
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-05 11:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-03  4:38 [PATCH i-g-t 1/3] Use PATH_MAX to fix some sprintf-into-short-buffers warnings Eric Anholt
2017-09-03  4:38 ` [PATCH i-g-t 2/3] intel_watermark: Fix a warning about "const char" return being silly Eric Anholt
2017-09-03  4:38 ` [PATCH i-g-t 3/3] intel_display_poller: Fix truncation of a test name Eric Anholt
2017-09-03  5:05 ` ✓ Fi.CI.BAT: success for series starting with [1/3] Use PATH_MAX to fix some sprintf-into-short-buffers warnings Patchwork
2017-09-03  6:02 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-04  8:49 ` [PATCH i-g-t 1/3] " Daniel Vetter
2017-09-05 11:44   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox