[dpkg] 112/200: u-a: Move xvasprintf() and xasprintf() definitions earlier in the code
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:17:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository dpkg.
commit bf4f4ab7c51b1415cbe940a972ec3d54bbdb5561
Author: Guillem Jover <guillem at debian.org>
Date: Sat Dec 31 11:56:35 2016 +0100
u-a: Move xvasprintf() and xasprintf() definitions earlier in the code
This will make it possible to use these functions without having to use
forward declarations.
---
utils/update-alternatives.c | 48 ++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 39f0c04..7a41c00 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -269,6 +269,30 @@ xstrdup(const char *str)
return new_str;
}
+static char * DPKG_ATTR_VPRINTF(1)
+xvasprintf(const char *fmt, va_list args)
+{
+ char *str;
+
+ if (vasprintf(&str, fmt, args) < 0)
+ error(_("failed to allocate memory"));
+
+ return str;
+}
+
+static char * DPKG_ATTR_PRINTF(1)
+xasprintf(const char *fmt, ...)
+{
+ va_list args;
+ char *str;
+
+ va_start(args, fmt);
+ str = xvasprintf(fmt, args);
+ va_end(args);
+
+ return str;
+}
+
static char *
areadlink(const char *linkname)
{
@@ -314,30 +338,6 @@ xreadlink(const char *linkname)
return buf;
}
-static char * DPKG_ATTR_VPRINTF(1)
-xvasprintf(const char *fmt, va_list args)
-{
- char *str;
-
- if (vasprintf(&str, fmt, args) < 0)
- error(_("failed to allocate memory"));
-
- return str;
-}
-
-static char * DPKG_ATTR_PRINTF(1)
-xasprintf(const char *fmt, ...)
-{
- va_list args;
- char *str;
-
- va_start(args, fmt);
- str = xvasprintf(fmt, args);
- va_end(args);
-
- return str;
-}
-
static void
set_action(const char *new_action)
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list