Skip to content

Commit

Permalink
Fix some documentation errors
Browse files Browse the repository at this point in the history
CLA: trivial

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#16684)
  • Loading branch information
PeiweiHu authored and paulidale committed Sep 28, 2021
1 parent 105af0a commit 9efdf4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/man3/BIO_s_file.pod
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ BIO_s_file() returns the file BIO method.
BIO_new_file() and BIO_new_fp() return a file BIO or NULL if an error
occurred.

BIO_set_fp() and BIO_get_fp() return 1 for success or 0 for failure
BIO_set_fp() and BIO_get_fp() return 1 for success or <=0 for failure
(although the current implementation never return 0).

BIO_seek() returns the same value as the underlying fseek() function:
Expand All @@ -96,7 +96,7 @@ BIO_seek() returns the same value as the underlying fseek() function:
BIO_tell() returns the current file position.

BIO_read_filename(), BIO_write_filename(), BIO_append_filename() and
BIO_rw_filename() return 1 for success or 0 for failure.
BIO_rw_filename() return 1 for success or <=0 for failure.

=head1 EXAMPLES

Expand All @@ -114,7 +114,7 @@ Alternative technique:
bio_out = BIO_new(BIO_s_file());
if (bio_out == NULL)
/* Error */
if (!BIO_set_fp(bio_out, stdout, BIO_NOCLOSE))
if (BIO_set_fp(bio_out, stdout, BIO_NOCLOSE) <= 0)
/* Error */
BIO_printf(bio_out, "Hello World\n");

Expand All @@ -135,7 +135,7 @@ Alternative technique:
out = BIO_new(BIO_s_file());
if (out == NULL)
/* Error */
if (!BIO_write_filename(out, "filename.txt"))
if (BIO_write_filename(out, "filename.txt") <= 0)
/* Error */
BIO_printf(out, "Hello World\n");
BIO_free(out);
Expand Down

0 comments on commit 9efdf4a

Please sign in to comment.