X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_crypto%2Fsha1%2Fmain.c;h=846297919945b5f2c2f83965dbcb3bb230142be5;hp=e6dda519847b215adb7a68e5c47e6f88606308d2;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/os_crypto/sha1/main.c b/src/os_crypto/sha1/main.c old mode 100755 new mode 100644 index e6dda51..8462979 --- a/src/os_crypto/sha1/main.c +++ b/src/os_crypto/sha1/main.c @@ -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 */