diff options
Diffstat (limited to 'src/divertcmd.c')
-rw-r--r-- | src/divertcmd.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/divertcmd.c b/src/divertcmd.c index dc035c248..b2ca8ce7b 100644 --- a/src/divertcmd.c +++ b/src/divertcmd.c @@ -159,7 +159,7 @@ check_writable_dir(struct file *f) char *tmpname; int tmpfd; - m_asprintf(&tmpname, "%s%s", f->name, ".dpkg-divert.tmp"); + tmpname = str_fmt("%s%s", f->name, ".dpkg-divert.tmp"); tmpfd = creat(tmpname, 0600); if (tmpfd < 0) @@ -216,7 +216,7 @@ file_copy(const char *src, const char *dst) if (srcfd < 0) ohshite(_("unable to open file '%s'"), src); - m_asprintf(&tmp, "%s%s", dst, ".dpkg-divert.tmp"); + tmp = str_fmt("%s%s", dst, ".dpkg-divert.tmp"); dstfd = creat(tmp, 0600); if (dstfd < 0) ohshite(_("unable to create file '%s'"), tmp); @@ -438,12 +438,8 @@ diversion_add(const char *const *argv) fnn_from = findnamenode(filename, 0); /* Handle divertto. */ - if (opt_divertto == NULL) { - char *str; - - m_asprintf(&str, "%s.distrib", filename); - opt_divertto = str; - } + if (opt_divertto == NULL) + opt_divertto = str_fmt("%s.distrib", filename); if (strcmp(filename, opt_divertto) == 0) badusage(_("cannot divert file '%s' to itself"), filename); |