From 15050ce5fce4ed815503db7c029abb38d08970d6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 2 Feb 2017 12:35:59 +0100 Subject: core: Replace all calls to *sprintf by gpgrt_*sprintf. * configure.ac (vasprintf): Remove check. * src/vasprintf.c: Remove file. * src/util.h (vasprintf, asprintf): Remove prototypes. Replace all calls to vasprintf and asprintf by gpgrt_vasprintf or gpgrt_asprintf. Also take care to use gpgrt_free on the returned value. * src/w32-util.c (_gpgme_get_gpgconf_path): Replace a gpgrt_asprintf by _gpgme_strconcat. (snprintf): New macro to use gpgrt_snprintf instead of the system's standard snprintf. Signed-off-by: Werner Koch --- src/util.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index a1be6e7e..b27c5833 100644 --- a/src/util.h +++ b/src/util.h @@ -95,11 +95,12 @@ _gpgme_stpcpy (char *a, const char *b) #define stpcpy(a,b) _gpgme_stpcpy ((a), (b)) #endif /*!HAVE_STPCPY*/ -#if !HAVE_VASPRINTF -#include -int vasprintf (char **result, const char *format, va_list args); -int asprintf (char **result, const char *format, ...); -#endif + +/* Due to a bug in mingw32's snprintf related to the 'l' modifier and + for increased portability we use our snprintf on all systems. */ +#undef snprintf +#define snprintf gpgrt_snprintf + #if REPLACE_TTYNAME_R int _gpgme_ttyname_r (int fd, char *buf, size_t buflen); -- cgit v1.2.3