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/debug.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/debug.c') diff --git a/src/debug.c b/src/debug.c index 1dd37234..e9bfc404 100644 --- a/src/debug.c +++ b/src/debug.c @@ -313,7 +313,7 @@ _gpgme_debug_begin (void **line, int level, const char *format, ...) } va_start (arg_ptr, format); - res = vasprintf ((char **) line, format, arg_ptr); + res = gpgrt_vasprintf ((char **) line, format, arg_ptr); va_end (arg_ptr); if (res < 0) *line = NULL; @@ -333,16 +333,16 @@ _gpgme_debug_add (void **line, const char *format, ...) return; va_start (arg_ptr, format); - res = vasprintf (&toadd, format, arg_ptr); + res = gpgrt_vasprintf (&toadd, format, arg_ptr); va_end (arg_ptr); if (res < 0) { - free (*line); + gpgrt_free (*line); *line = NULL; } - res = asprintf (&result, "%s%s", *(char **) line, toadd); - free (toadd); - free (*line); + res = gpgrt_asprintf (&result, "%s%s", *(char **) line, toadd); + gpgrt_free (toadd); + gpgrt_free (*line); if (res < 0) *line = NULL; else @@ -361,7 +361,7 @@ _gpgme_debug_end (void **line) /* The smallest possible level is 1, so force logging here by using that. */ _gpgme_debug (1, "%s", *line); - free (*line); + gpgrt_free (*line); *line = NULL; } -- cgit v1.2.3