diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-10-03 12:45:01 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-10-03 12:47:47 +0200 |
commit | 749309117723ee4795d16ce4f744e4b099e4979a (patch) | |
tree | f917e8ce8ba8562b9afdb6fbb51e4e8d239e7add | |
parent | 8155a05c650b1d24e8ee025640a8400119c91eda (diff) |
media-ctl: fix compiler warnings
media-ctl.c: In function v4l2_subdev_print_dv_timings:
media-ctl.c:169:32: warning: sprintf may write a terminating nul past the end of the destination [-Wformat-overflow=]
169 | sprintf(unknown, "Unknown (%u)", type);
| ^
media-ctl.c:169:2: note: sprintf output between 12 and 21 bytes into a destination of size 20
169 | sprintf(unknown, "Unknown (%u)", type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Increase array size from 20 to 21.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | utils/media-ctl/media-ctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c index 455b92a3..84ee7a83 100644 --- a/utils/media-ctl/media-ctl.c +++ b/utils/media-ctl/media-ctl.c @@ -158,7 +158,7 @@ static const char *v4l2_dv_type_to_string(unsigned int type) { V4L2_DV_BT_656_1120, "BT.656/1120" }, }; - static char unknown[20]; + static char unknown[21]; unsigned int i; for (i = 0; i < ARRAY_SIZE(types); i++) { |