From 519305feb888b529c005b40445d041a088a2f8fc Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 26 Aug 2014 17:47:22 +0200 Subject: Switch to the libgpg-error provided estream. * configure.ac (NEED_GPG_ERROR_VERSION): Reguire 1.14. (GPGRT_ENABLE_ES_MACROS): Define. (estream_INIT): Remove. * m4/estream.m4: Remove. * common/estream-printf.c, common/estream-printf.h: Remove. * common/estream.c, common/estream.h: Remove. * common/init.c (_init_common_subsystems): Call gpgrt initialization. --- common/xasprintf.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'common/xasprintf.c') 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 #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; -- cgit v1.2.3