summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-10-18 15:34:45 +0200
committerGuillem Jover <guillem@debian.org>2015-12-12 21:49:37 +0100
commit0db77512a15877ca25384b775406323a2302c125 (patch)
tree68167f8660ac41510c90a497664ab0eb16ef6702 /src/main.c
parent302829039a4dba8a37fa31dfc0e06ca4a8e5a04b (diff)
downloaddpkg-0db77512a15877ca25384b775406323a2302c125.tar.gz
Use new str_fmt() instead of m_asprintf()
It should make the code more clear, and in many cases it avoids having to use a temporary variable.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 789e656fb..0ff04f19b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -360,11 +360,8 @@ set_instdir(const struct cmdinfo *cip, const char *value)
static void
set_root(const struct cmdinfo *cip, const char *value)
{
- char *p;
-
set_instdir(cip, value);
- m_asprintf(&p, "%s%s", instdir, ADMINDIR);
- admindir= p;
+ admindir = str_fmt("%s%s", instdir, ADMINDIR);
}
static void
@@ -751,13 +748,10 @@ int
execbackend(const char *const *argv)
{
struct command cmd;
- char *arg;
command_init(&cmd, cipaction->arg_ptr, NULL);
command_add_arg(&cmd, cipaction->arg_ptr);
-
- m_asprintf(&arg, "--%s", cipaction->olong);
- command_add_arg(&cmd, arg);
+ command_add_arg(&cmd, str_fmt("--%s", cipaction->olong));
/* Exlicitely separate arguments from options as any user-supplied
* separator got stripped by the option parser */