Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2 1/2] lib/igt_sysfs: Use same var for sizeof()
@ 2024-02-22 19:33 Lucas De Marchi
  2024-02-22 19:33 ` [PATCH i-g-t v2 2/2] lib/igt_sysfs: make sure to write empty strings Lucas De Marchi
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Lucas De Marchi @ 2024-02-22 19:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Janusz Krzysztofik, Lucas De Marchi

Let's guarantee we always pass the same pointer to vsnprintf: if we are
using the array size, pass that instead of buf that could point to
something else in an eventual refactor.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 51b610114..2b0225138 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -513,7 +513,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
 		return -errno;
 
 	va_copy(tmp, ap);
-	ret = vsnprintf(buf, sizeof(stack), fmt, tmp);
+	ret = vsnprintf(stack, sizeof(stack), fmt, tmp);
 	va_end(tmp);
 	if (igt_debug_on(ret < 0))
 		return -EINVAL;
-- 
2.43.0


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

end of thread, other threads:[~2024-02-27  5:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22 19:33 [PATCH i-g-t v2 1/2] lib/igt_sysfs: Use same var for sizeof() Lucas De Marchi
2024-02-22 19:33 ` [PATCH i-g-t v2 2/2] lib/igt_sysfs: make sure to write empty strings Lucas De Marchi
2024-02-26 21:11   ` Janusz Krzysztofik
2024-02-27  5:26     ` Lucas De Marchi
2024-02-22 20:15 ` ✓ CI.xeBAT: success for series starting with [i-g-t,v2,1/2] lib/igt_sysfs: Use same var for sizeof() Patchwork
2024-02-22 20:23 ` ✓ Fi.CI.BAT: " Patchwork
2024-02-22 21:29 ` [PATCH i-g-t v2 1/2] " Rodrigo Vivi
2024-02-23  7:01 ` ✗ Fi.CI.IGT: failure for series starting with [i-g-t,v2,1/2] " Patchwork

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