From eb13267f82e848d9a9b38a2791e5c7008bf8d157 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 27 Apr 2016 00:39:31 +0200 Subject: zstr: add new parameter, n: the known limit out the length of the output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- man/zstr.3 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'man/zstr.3') diff --git a/man/zstr.3 b/man/zstr.3 index 04cacd9..568e32c 100644 --- a/man/zstr.3 +++ b/man/zstr.3 @@ -5,7 +5,7 @@ zstr - Create a string representation of a big integer .nf #include -char *zstr(z_t \fIa\fP, char *\fIstr\fP); +char *zstr(z_t \fIa\fP, char *\fIstr\fP, size_t \fIn\fP); .fi .SH DESCRIPTION .B zstr @@ -19,6 +19,22 @@ is is .BR 0 , .B zstr create a new allocation. +.P +.I n +must be either be zero or a value at least +as great as the length of the resulting string. +If both +.I n +and +.I str +are nonzero, +.I n +must be at least the allocation size of +.I str +minus 1. Proper value for +.I n +can be calculated using +.BR zstr_length (3). .SH RETURN VALUE .I str is returned unless -- cgit v1.2.3-70-g09d2