summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/rpmdb.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index ba6ef2300..4bc70004d 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -3361,13 +3361,8 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
tfn = rpmGetPath("%{?_dbpath_rebuild}", NULL);
if (!(tfn && tfn[0] != '\0' && strcmp(tfn, dbpath)))
{
- char pidbuf[20];
- char *t;
- sprintf(pidbuf, "rebuilddb.%d", (int) getpid());
- t = xmalloc(strlen(dbpath) + strlen(pidbuf) + 1);
- (void)stpcpy(stpcpy(t, dbpath), pidbuf);
tfn = _free(tfn);
- tfn = t;
+ rasprintf(&tfn, "%srebuilddb.%d", dbpath, (int) getpid());
nocleanup = 0;
}
newdbpath = newrootdbpath = rpmGetPath(prefix, tfn, NULL);