diff options
author | Werner Koch <[email protected]> | 2014-09-08 17:26:02 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-09-08 17:26:02 +0000 |
commit | 64329cce9a0f21cf941ff2c3f542a08c57cb5378 (patch) | |
tree | 2757f807c51b06645bff08cb9c85c72e49b151d9 /common/xasprintf.c | |
parent | gpg: Do not show "MD5" and triplicated "RSA" in --version. (diff) | |
parent | gpg: Fix memory leak in ECC encryption. (diff) | |
download | gnupg-64329cce9a0f21cf941ff2c3f542a08c57cb5378.tar.gz gnupg-64329cce9a0f21cf941ff2c3f542a08c57cb5378.zip |
Merge branch 'wk/test-gpgrt-estream'
Diffstat (limited to 'common/xasprintf.c')
-rw-r--r-- | common/xasprintf.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/common/xasprintf.c b/common/xasprintf.c index b1fb9c692..8adf2e471 100644 --- a/common/xasprintf.c +++ b/common/xasprintf.c @@ -32,15 +32,14 @@ #include <errno.h> #include "util.h" -#include "iobuf.h" - -#if !defined(_ESTREAM_PRINTF_REALLOC) -#error Need to define _ESTREAM_PRINTF_REALLOC -#endif /* Same as asprintf but return an allocated buffer suitable to be freed using xfree. This function simply dies on memory failure, - thus no extra check is required. */ + thus no extra check is required. + + FIXME: We should remove these functions in favor of gpgrt_bsprintf + and a xgpgrt_bsprintf or rename them to xbsprintf and + xtrybsprintf. */ char * xasprintf (const char *fmt, ...) { @@ -48,7 +47,7 @@ xasprintf (const char *fmt, ...) char *buf; va_start (ap, fmt); - if (estream_vasprintf (&buf, fmt, ap) < 0) + if (gpgrt_vasprintf (&buf, fmt, ap) < 0) log_fatal ("estream_asprintf failed: %s\n", strerror (errno)); va_end (ap); return buf; @@ -63,7 +62,7 @@ xtryasprintf (const char *fmt, ...) char *buf; va_start (ap, fmt); - rc = estream_vasprintf (&buf, fmt, ap); + rc = gpgrt_vasprintf (&buf, fmt, ap); va_end (ap); if (rc < 0) return NULL; |