Browse Source

Check tor_sscanf return value in test_crypto.c

Coverity noticed that we check tor_sscanf's return value everywhere
else.
Nick Mathewson 7 years ago
parent
commit
83513a93a1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/test/test_crypto.c

+ 2 - 1
src/test/test_crypto.c

@@ -162,7 +162,8 @@ test_crypto_openssl_version(void *arg)
   tt_assert(!strcmpstart(version, h_version)); /* "-fips" suffix, etc */
   tt_assert(!strstr(version, "OpenSSL"));
   int a=-1,b=-1,c=-1;
-  tor_sscanf(version, "%d.%d.%d", &a,&b,&c);
+  int r = tor_sscanf(version, "%d.%d.%d", &a,&b,&c);
+  tt_int_op(r, OP_EQ, 3);
   tt_int_op(a, OP_GE, 0);
   tt_int_op(b, OP_GE, 0);
   tt_int_op(c, OP_GE, 0);