]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
C89-compliance.
authorDmitry Belyavskiy <beldmit@gmail.com>
Tue, 4 Jul 2017 10:33:42 +0000 (13:33 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Tue, 4 Jul 2017 10:33:42 +0000 (13:33 +0300)
gost12sum.c

index f59bc05e4c2f1e43f080e34f7f2b10f28a7662cb..e766baca283af224f42eb72219fa81f0b7e9dcf1 100644 (file)
@@ -216,6 +216,7 @@ 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;
 
     start_hash12(ctx);
     while ((bytes = read(fd, buffer, BUF_SIZE)) > 0) {
@@ -225,7 +226,7 @@ int hash_stream(gost_hash_ctx * ctx, int fd, char *sum)
         return 0;
     }
     finish_hash12(ctx, buffer);
-    for (size_t i = 0; i < (hashsize / 8); i++) {
+    for (i = 0; i < (hashsize / 8); i++) {
         sprintf(sum + 2 * i, "%02x", buffer[i]);
     }
     return 1;