Skip to content

Commit

Permalink
utils: iio_info: Explicitely cast error codes to int
Browse files Browse the repository at this point in the history
iio_strerror() expects an "int" value for the error code. Visual Studio
will complain if we are passing a ssize_t, as it is a downcast. However,
we know that error codes all fit in "int", so the downcast is safe.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Dec 11, 2023
1 parent 71c069f commit 1270272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/iio_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static void print_attr(const struct iio_attr *attr,
if (!value) {
ret = iio_attr_read_raw(attr, buf, sizeof(buf) - 1);
if (ret < 0)
iio_strerror(ret, buf, sizeof(buf));
iio_strerror((int)ret, buf, sizeof(buf));
value = buf;
}

Expand Down

0 comments on commit 1270272

Please sign in to comment.