diff options
author | Denis Vlasenko | 2006-09-09 12:24:19 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-09-09 12:24:19 +0000 |
commit | 9cac521f07550764e94c469d70b22ad5c194855a (patch) | |
tree | 98f3e605a5b17bffc9e1f087907bf15049d6e717 /archival/rpm.c | |
parent | 3526a1320a7e70be0def06a31b65ffff3430510b (diff) | |
download | busybox-9cac521f07550764e94c469d70b22ad5c194855a.zip busybox-9cac521f07550764e94c469d70b22ad5c194855a.tar.gz |
using [xa]sprintf for string concatenation is neat and saves
~100 bytes according to bloatcheck. Also this fixes bug in rpm
Diffstat (limited to 'archival/rpm.c')
-rw-r--r-- | archival/rpm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/archival/rpm.c b/archival/rpm.c index d399e0e..a459839 100644 --- a/archival/rpm.c +++ b/archival/rpm.c @@ -290,8 +290,7 @@ static void fileaction_dobackup(char *filename, int fileref) if (rpm_getint(RPMTAG_FILEFLAGS, fileref) & RPMFILE_CONFIG) { /* Only need to backup config files */ stat_res = lstat (filename, &oldfile); if (stat_res == 0 && S_ISREG(oldfile.st_mode)) { /* File already exists - really should check MD5's etc to see if different */ - newname = xstrdup(filename); - newname = strcat(newname, ".rpmorig"); + newname = xasprintf("%s.rpmorig", filename); copy_file(filename, newname, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS); remove_file(filename, FILEUTILS_RECUR | FILEUTILS_FORCE); free(newname); |