Avoid warnings.
[openssl.git] / apps / dgst.c
index 2926e5514f9b767a1a5b70557529481f8f24778c..5f0506ed8cd6b65c4ceb797dd4fee994dd64563c 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 #include "apps.h"
-#include "bio.h"
-#include "err.h"
-#include "evp.h"
-#include "objects.h"
-#include "x509.h"
-#include "pem.h"
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
 
 #undef BUFSIZE
 #define BUFSIZE        1024*8
 #undef PROG
 #define PROG   dgst_main
 
-#ifndef NOPROTO
 void do_fp(unsigned char *buf,BIO *f,int sep);
-#else
-void do_fp();
-#endif
-
 int MAIN(int argc, char **argv)
        {
        unsigned char *buf=NULL;
@@ -88,7 +83,7 @@ int MAIN(int argc, char **argv)
        BIO *bmd=NULL;
        const char *name;
 #define PROG_NAME_SIZE  16
-        char pname[PROG_NAME_SIZE];
+       char pname[PROG_NAME_SIZE];
        int separator=0;
        int debug=0;
 
@@ -104,13 +99,13 @@ int MAIN(int argc, char **argv)
                        BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
 
        /* first check the program name */
-        program_name(argv[0],pname,PROG_NAME_SIZE);
+       program_name(argv[0],pname,PROG_NAME_SIZE);
 
        md=EVP_get_digestbyname(pname);
 
        argc--;
        argv++;
-       for (i=0; i<argc; i++)
+       while (argc > 0)
                {
                if ((*argv)[0] != '-') break;
                if (strcmp(*argv,"-c") == 0)
@@ -187,7 +182,7 @@ int MAIN(int argc, char **argv)
                                }
                        printf("%s(%s)= ",name,argv[i]);
                        do_fp(buf,inp,separator);
-                       BIO_reset(bmd);
+                       (void)BIO_reset(bmd);
                        }
                }
 end: