diff mbox series

[1/6] media: cec.h: increase input_phys buffer

Message ID 20230922125837.3290073-2-hverkuil-cisco@xs4all.nl
State Accepted
Commit 7ba5e7b78b068e212c85926723990482ee7b1962
Headers show
Series media: string truncate warnings: increase name fields | expand

Commit Message

Hans Verkuil Sept. 22, 2023, 12:58 p.m. UTC
Fixes this compiler warning:

drivers/media/cec/core/cec-core.c: In function 'cec_allocate_adapter':
drivers/media/cec/core/cec-core.c:317:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
  317 |                  "%s/input0", adap->name);
      |                     ^~~~~~~
drivers/media/cec/core/cec-core.c:316:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
  316 |         snprintf(adap->input_phys, sizeof(adap->input_phys),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317 |                  "%s/input0", adap->name);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 include/media/cec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/media/cec.h b/include/media/cec.h
index 9c007f83569a..53e4b2eb2b26 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -275,7 +275,7 @@  struct cec_adapter {
 
 	u32 sequence;
 
-	char input_phys[32];
+	char input_phys[40];
 };
 
 static inline void *cec_get_drvdata(const struct cec_adapter *adap)