New function ERR_error_string_n.
[openssl.git] / apps / errstr.c
index d2b2b3fcea1996aa329b0e4ad726a32ffb18684d..2c6204647692bf5150db3104958ec22c8987f290 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include "apps.h"
-#include "bio.h"
-#include "lhash.h"
-#include "err.h"
-#include "ssl.h"
+#include <openssl/bio.h>
+#include <openssl/lhash.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
 
 #undef PROG
 #define PROG   errstr_main
 
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int, char **);
+
+int MAIN(int argc, char **argv)
        {
        int i,ret=0;
        char buf[256];
@@ -104,7 +104,10 @@ char **argv;
        for (i=1; i<argc; i++)
                {
                if (sscanf(argv[i],"%lx",&l))
-                       printf("%s\n",ERR_error_string(l,buf));
+                       {
+                       ERR_error_string_n(l, buf, sizeof buf);
+                       printf("%s\n",buf);
+                       }
                else
                        {
                        printf("%s: bad error code\n",argv[i]);