new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_crypto / sha1 / main.c
old mode 100755 (executable)
new mode 100644 (file)
index e6dda51..8462979
@@ -4,33 +4,26 @@
 
 #include "sha1_op.h"
 
+
 void usage(char **argv)
 {
     printf("%s file\n", argv[0]);
     exit(1);
 }
 
-/* make main to compile (after the make md5)
- * Example of the md5 API use
- * Daniel B. Cid, dcid@ossec.net
- */
-int main(int argc, char ** argv)
+int main(int argc, char **argv)
 {
     os_sha1 filesum;
 
-    if(argc < 2)
+    if (argc < 2) {
         usage(argv);
-
-
-    if(OS_SHA1_File(argv[1], filesum) == 0)
-    {
-        printf("SHA1Sum for \"%s\" is: %s\n",argv[1],filesum);
     }
-    else
-    {
+
+    if (OS_SHA1_File(argv[1], filesum, OS_BINARY) == 0) {
+        printf("SHA1Sum for \"%s\" is: %s\n", argv[1], filesum);
+    } else {
         printf("SHA1Sum for \"%s\" failed\n", argv[1]);
     }
-    return(0);
+    return (0);
 }
 
-/* EOF */