summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-17 14:01:23 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-17 14:01:23 +0200
commitb9f2b0788a19f76e89d782a76bc3d784fe4307d9 (patch)
tree8f29bc8e0a383789a67f79046f5652fe9e5f8fc2
parent898d2cc867aef7a8637a2afcded0d24baf6d110e (diff)
downloadlibrpm-tizen-b9f2b0788a19f76e89d782a76bc3d784fe4307d9.tar.gz
librpm-tizen-b9f2b0788a19f76e89d782a76bc3d784fe4307d9.tar.bz2
librpm-tizen-b9f2b0788a19f76e89d782a76bc3d784fe4307d9.zip
Drop bogus const from fsmFsPath() return type
- path is malloced and caller needs to free - additionally use size_t, not int for string size
-rw-r--r--lib/fsm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index e402f598c..271bd2ebc 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -80,18 +80,17 @@ rpmfi fsmGetFi(const FSM_t fsm)
* @param st file stat info
* @param subdir subdir to use (NULL disables)
* @param suffix suffix to use (NULL disables)
- * @retval path to file
+ * @retval path to file (malloced)
*/
-static
-const char * fsmFsPath(const FSM_t fsm,
+static char * fsmFsPath(const FSM_t fsm,
const struct stat * st,
const char * subdir,
const char * suffix)
{
- const char * s = NULL;
+ char * s = NULL;
if (fsm) {
- int nb;
+ size_t nb;
char * t;
nb = strlen(fsm->dirName) +
(st && !S_ISDIR(st->st_mode) ? (subdir ? strlen(subdir) : 0) : 0) +
@@ -1806,7 +1805,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
fsm->path = fsmFsPath(fsm, st, NULL, fsm->nsuffix);
rc = fsmNext(fsm, FSM_RENAME);
if (!rc && fsm->nsuffix) {
- const char * opath = fsmFsPath(fsm, st, NULL, NULL);
+ char * opath = fsmFsPath(fsm, st, NULL, NULL);
rpmlog(RPMLOG_WARNING, _("%s created as %s\n"),
(opath ? opath : ""),
(fsm->path ? fsm->path : ""));