mirror of
https://github.com/BLAKE3-team/BLAKE3
synced 2024-05-11 09:36:09 +02:00
clean up the C example a bit
This commit is contained in:
parent
0432f9c7a3
commit
48f2f745d9
|
@ -28,6 +28,7 @@ prints the result:
|
|||
```c
|
||||
#include "blake3.h"
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
// Initialize the hasher.
|
||||
|
@ -36,8 +37,8 @@ int main() {
|
|||
|
||||
// Read input bytes from stdin.
|
||||
unsigned char buf[65536];
|
||||
size_t n;
|
||||
while ((n = fread(buf, 1, 65536, stdin)) > 0) {
|
||||
ssize_t n;
|
||||
while ((n = read(STDIN_FILENO, buf, sizeof(buf))) > 0) {
|
||||
blake3_hasher_update(&hasher, buf, n);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue