aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 14:41:25 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 14:41:25 +0100
commitd26ad862a13f9b581321e9913626428c66a85981 (patch)
treea1d3f2b956fb3a03e321174cd71cf688364e46c2 /utils/v4l2-ctl
parent80c8da2569568fa06b39279a8ea6cb51f3e87a0a (diff)
v4l2-ctl: fix compiler warning
v4l2-ctl-streaming.cpp: In function ‘__u32 read_u32(FILE*)’: v4l2-ctl-streaming.cpp:434:7: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&v, 1, sizeof(v), f); ^ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'utils/v4l2-ctl')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index da25e0d2..31670738 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -431,7 +431,8 @@ static __u32 read_u32(FILE *f)
{
__u32 v;
- fread(&v, 1, sizeof(v), f);
+ if (fread(&v, 1, sizeof(v), f) != sizeof(v))
+ return 0;
return ntohl(v);
}

Privacy Policy