X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost12sum.c;h=f643b8bbf407ac39db738914b9c559cd170ea694;hb=9128b0a98a8f89be2830eabca0cdc0b6b344172b;hp=e766baca283af224f42eb72219fa81f0b7e9dcf1;hpb=ea678abc1f9ea5acfdf2d5e5d6fa1c62add0631f;p=openssl-gost%2Fengine.git diff --git a/gost12sum.c b/gost12sum.c index e766bac..f643b8b 100644 --- a/gost12sum.c +++ b/gost12sum.c @@ -10,7 +10,16 @@ **********************************************************************/ #include #include -#include +#ifdef _MSC_VER +# include "getopt.h" +# ifndef PATH_MAX +# define PATH_MAX _MAX_PATH +# endif +# include +typedef SSIZE_T ssize_t; +#else +# include +#endif #include #include #ifdef _WIN32 @@ -214,13 +223,12 @@ int hash_file(gost_hash_ctx * ctx, char *filename, char *sum, int mode) int hash_stream(gost_hash_ctx * ctx, int fd, char *sum) { unsigned char buffer[BUF_SIZE]; - unsigned char reverted_buffer[BUF_SIZE]; ssize_t bytes; - size_t i; + size_t i; start_hash12(ctx); while ((bytes = read(fd, buffer, BUF_SIZE)) > 0) { - hash12_block(ctx, reverted_buffer, bytes); + hash12_block(ctx, buffer, bytes); } if (bytes < 0) { return 0; @@ -261,7 +269,7 @@ int get_line(FILE *f, char *hash, char *filename, int verbose) return 1; nextline: if (verbose) - printf("%s\n", filename); + printf("%s\n", filename); } return 0; }