1.\" $OpenBSD: ERR_asprintf_error_data.3,v 1.2 2017/02/21 07:15:21 jmc Exp $
2.\"
3.\" Copyright (c) 2017 Bob Beck <beck@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.Dd $Mdocdate: February 21 2017 $
17.Dt ERR_ASPRINTF_ERROR_DATA 3
18.Os
19.Sh NAME
20.Nm ERR_asprintf_error_data
21.Nd record a LibreSSL error using a formatted string
22.Sh SYNOPSIS
23.In openssl/err.h
24.Ft void
25.Fo ERR_asprintf_error_data
26.Fa "char * format"
27.Fa ...
28.Fc
29.Sh DESCRIPTION
30.Nm
31builds a string using
32.Xr asprintf 3
33called with the provided
34.Ar format
35and arguments.
36The resulting string is then associated with the error code that was most
37recently added.
38If
39.Xr asprintf 3
40fails, the string "malloc failed" is associated instead.
41.Pp
42.Nm
43is intended to be used instead of the OpenSSL functions
44.Xr ERR_add_error_data 3
45and
46.Xr ERR_add_error_vdata 3 .
47.Sh SEE ALSO
48.Xr ERR 3 ,
49.Xr ERR_put_error 3 ,
50.Xr printf 3
51.Sh HISTORY
52.Nm
53appeared in
54.Ox 5.6
55and is available in all versions of LibreSSL.
56