From 48f2f745d9c656b1d4d2880fe5630510b8cfba5d Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Sun, 1 Mar 2020 17:33:36 -0500 Subject: [PATCH] clean up the C example a bit --- c/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c/README.md b/c/README.md index 43bcd77..af408a1 100644 --- a/c/README.md +++ b/c/README.md @@ -28,6 +28,7 @@ prints the result: ```c #include "blake3.h" #include +#include 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); }