Support SM2 in apps/speed
[openssl.git] / apps / dgst.c
index 7b433385861625595529080fe40c4dec7c1219d3..b44468bc796a61287530e9f28481a09b495413c6 100644 (file)
@@ -461,7 +461,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
     size_t len;
     int i, backslash = 0;
 
-    for (;;) {
+    while (BIO_pending(bp) || !BIO_eof(bp)) {
         i = BIO_read(bp, (char *)buf, BUFSIZE);
         if (i < 0) {
             BIO_printf(bio_err, "Read Error in %s\n", file);