For -hex, print just one \n
authorBodo Möller <bodo@openssl.org>
Mon, 2 Feb 2009 00:40:29 +0000 (00:40 +0000)
committerBodo Möller <bodo@openssl.org>
Mon, 2 Feb 2009 00:40:29 +0000 (00:40 +0000)
apps/rand.c

index 7214a9d2a80da033cc59edd5cf23e743924c84e1..44a1d46a03cdcdb48116fcfefa2c06300a8cee05 100644 (file)
@@ -229,10 +229,11 @@ int MAIN(int argc, char **argv)
                        {
                        for (i = 0; i < chunk; i++)
                                BIO_printf(out, "%02x", buf[i]);
                        {
                        for (i = 0; i < chunk; i++)
                                BIO_printf(out, "%02x", buf[i]);
-                       BIO_puts(out, "\n");
                        }
                num -= chunk;
                }
                        }
                num -= chunk;
                }
+       if (hex)
+               BIO_puts(out, "\n");
        (void)BIO_flush(out);
 
        app_RAND_write_file(NULL, bio_err);
        (void)BIO_flush(out);
 
        app_RAND_write_file(NULL, bio_err);