Skip to content

Commit

Permalink
context: Fix implicit cast from ssize_t to int
Browse files Browse the repository at this point in the history
We know the error value is contained between -4095 and 0, but MSVC still
complains that we might lose data with the implicit cast. Suppress the
warning with an explicit cast.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Feb 24, 2022
1 parent b115021 commit 6323ecc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion context.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ iio_create_context_from_xml(const struct iio_context_params *params,
len = iio_snprintf(NULL, 0, "%s %s",
ctx->description, description);
if (len < 0) {
prm_perror(params, -len, "Unable to set context description\n");
prm_perror(params, -(int) len,
"Unable to set context description\n");
goto err_context_destroy;
}

Expand Down

0 comments on commit 6323ecc

Please sign in to comment.