Fix errstr error code parsing
authorMatt Caswell <matt@openssl.org>
Wed, 10 Feb 2016 19:41:27 +0000 (19:41 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 11 Feb 2016 08:53:11 +0000 (08:53 +0000)
Error codes are printed in hex, and previous OpenSSL versions expected
the error codes to be provided to errstr in hex. In 1.1.0, for some
reason, it was expecting them to be decimal.

Reviewed-by: Richard Levitte <levitte@openssl.org>
apps/errstr.c

index 99bb9e9068f27186a0e77361986c82c6def951c9..141338adac4bd7c0966ec6247aa7f6ead1c9db1e 100644 (file)
@@ -111,7 +111,7 @@ int errstr_main(int argc, char **argv)
 
     ret = 0;
     for (argv = opt_rest(); *argv; argv++) {
 
     ret = 0;
     for (argv = opt_rest(); *argv; argv++) {
-        if (!opt_ulong(*argv, &l))
+        if (sscanf(*argv, "%lx", &l) == 0)
             ret++;
         else {
             /* We're not really an SSL application so this won't auto-init, but
             ret++;
         else {
             /* We're not really an SSL application so this won't auto-init, but