This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

commit 670e9d691f0ca4d8dd1c693a8cb47218404f76ac
Author: Guillem Jover <[email protected]>
Date:   Sun Dec 2 21:52:29 2012 +0100

    libdpkg: Factor out new m_vasprintf() from m_asprintf()
---
 lib/dpkg/dpkg.h      |  2 ++
 lib/dpkg/libdpkg.map |  1 +
 lib/dpkg/mlib.c      | 18 ++++++++++++++----
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/dpkg/dpkg.h b/lib/dpkg/dpkg.h
index a58d315..9311375 100644
--- a/lib/dpkg/dpkg.h
+++ b/lib/dpkg/dpkg.h
@@ -145,6 +145,8 @@ void *m_realloc(void *, size_t);
 char *m_strdup(const char *str);
 char *m_strndup(const char *str, size_t n);
 int m_asprintf(char **strp, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
+int m_vasprintf(char **strp, const char *fmt, va_list args)
+       DPKG_ATTR_VPRINTF(2);
 void m_dup2(int oldfd, int newfd);
 void m_pipe(int fds[2]);
 void m_output(FILE *f, const char *name);
diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map
index dbc8e8b..6fe9385 100644
--- a/lib/dpkg/libdpkg.map
+++ b/lib/dpkg/libdpkg.map
@@ -62,6 +62,7 @@ LIBDPKG_PRIVATE {
        m_calloc;
        m_realloc;
        m_strdup;
+       m_vasprintf;
        m_asprintf;
        m_dup2;
        m_pipe;
diff --git a/lib/dpkg/mlib.c b/lib/dpkg/mlib.c
index 6e2dc19..8f99e51 100644
--- a/lib/dpkg/mlib.c
+++ b/lib/dpkg/mlib.c
@@ -84,14 +84,11 @@ m_strndup(const char *str, size_t n)
 }
 
 int
-m_asprintf(char **strp, const char *fmt, ...)
+m_vasprintf(char **strp, const char *fmt, va_list args)
 {
-  va_list args;
   int n;
 
-  va_start(args, fmt);
   n = vasprintf(strp, fmt, args);
-  va_end(args);
 
   onerr_abort++;
   if (n < 0)
@@ -101,6 +98,19 @@ m_asprintf(char **strp, const char *fmt, ...)
   return n;
 }
 
+int
+m_asprintf(char **strp, const char *fmt, ...)
+{
+  va_list args;
+  int n;
+
+  va_start(args, fmt);
+  n = m_vasprintf(strp, fmt, args);
+  va_end(args);
+
+  return n;
+}
+
 void m_dup2(int oldfd, int newfd) {
   const char *const stdstrings[]= { "in", "out", "err" };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/dpkg/dpkg.git


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to