diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-12-17 14:01:23 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-12-17 14:01:23 +0200 |
commit | b9f2b0788a19f76e89d782a76bc3d784fe4307d9 (patch) | |
tree | 8f29bc8e0a383789a67f79046f5652fe9e5f8fc2 /lib | |
parent | 898d2cc867aef7a8637a2afcded0d24baf6d110e (diff) | |
download | librpm-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fsm.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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 : "")); |