new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_crypto / md5 / main.c
old mode 100755 (executable)
new mode 100644 (file)
index 5eab951..7fb22a8
@@ -4,39 +4,34 @@
 
 #include "md5_op.h"
 
+
 void usage(char **argv)
 {
-    printf("%s file str\n%s str string\n",argv[0],argv[0]);
+    printf("%s file str\n%s str string\n", argv[0], 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_md5 filesum;
 
-    if(argc < 3)
+    if (argc < 3) {
         usage(argv);
+    }
 
-
-    if(strcmp(argv[1],"file") == 0)
-    {
-        OS_MD5_File(argv[2], filesum);
+    if (strcmp(argv[1], "file") == 0) {
+        OS_MD5_File(argv[2], filesum, OS_BINARY);
     }
 
-    else if(strcmp(argv[1],"str") == 0)
-    {
+    else if (strcmp(argv[1], "str") == 0) {
         OS_MD5_Str(argv[2], filesum);
     }
 
-    else
+    else {
         usage(argv);
+    }
 
-    printf("MD5Sum for \"%s\" is: %s\n",argv[2],filesum);
-    return(0);
+    printf("MD5Sum for \"%s\" is: %s\n", argv[2], filesum);
+    return (0);
 }
 
-/* EOF */