[ovs-dev] [coverity3 13/13] ovsdb: Explicitly ignore sscanf() return value in is_valid_version().

Ethan Jackson ethan at nicira.com
Wed Feb 23 22:59:10 UTC 2011


Looks Fine.


On Wed, Feb 23, 2011 at 1:24 PM, Ben Pfaff <blp at nicira.com> wrote:
> The return value isn't interesting here: it will always be 0.
>
> Coverity #10698.
> ---
>  ovsdb/ovsdb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c
> index 2a54a7b..e76544e 100644
> --- a/ovsdb/ovsdb.c
> +++ b/ovsdb/ovsdb.c
> @@ -123,7 +123,7 @@ static bool
>  is_valid_version(const char *s)
>  {
>     int n = -1;
> -    sscanf(s, "%*[0-9].%*[0-9].%*[0-9]%n", &n);
> +    ignore(sscanf(s, "%*[0-9].%*[0-9].%*[0-9]%n", &n));
>     return n != -1 && s[n] == '\0';
>  }
>
> --
> 1.7.2.3
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>




More information about the dev mailing list