aboutsummaryrefslogtreecommitdiffstats
path: root/src/debug.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-02-02 11:35:59 +0000
committerWerner Koch <[email protected]>2017-02-02 11:35:59 +0000
commit15050ce5fce4ed815503db7c029abb38d08970d6 (patch)
treed0c58db0e44d9f94c2655845482027b678918819 /src/debug.c
parentcore: Remove unused check for funopen/fopencookie. (diff)
downloadgpgme-15050ce5fce4ed815503db7c029abb38d08970d6.tar.gz
gpgme-15050ce5fce4ed815503db7c029abb38d08970d6.zip
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 <[email protected]>
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c14
1 files changed, 7 insertions, 7 deletions
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;
}