diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/header.c | 4 | ||||
-rw-r--r-- | lib/psm.c | 9 | ||||
-rw-r--r-- | lib/rpmlib.h | 6 | ||||
-rw-r--r-- | lib/transaction.c | 4 |
4 files changed, 18 insertions, 5 deletions
diff --git a/lib/header.c b/lib/header.c index aa5bba485..6d3a2f6e1 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1590,7 +1590,11 @@ int headerAddI18NString(Header h, int_32 tag, const char * string, const char * entry->data = xrealloc(entry->data, entry->length + length); memset(((char *)entry->data) + entry->length, '\0', ghosts); +#if 0 strcpy(((char *)entry->data) + entry->length + ghosts, string); +#else + memmove(((char *)entry->data) + entry->length + ghosts, string, strlen(string)+1); +#endif entry->length += length; entry->info.count = langNum + 1; @@ -23,12 +23,15 @@ /*@access FSM_t @*/ /* compared with NULL */ /*@access PSM_t @*/ /* compared with NULL */ /*@access FD_t @*/ /* compared with NULL */ +/*@access rpmdb @*/ /* compared with NULL */ /*@-redecl@*/ extern int _fsm_debug; /*@=redecl@*/ +/*@-redecl -declundef -exportheadervar@*/ extern const char * chroot_prefix; +/*@=redecl =declundef =exportheadervar@*/ int rpmVersionCompare(Header first, Header second) { @@ -1857,8 +1860,10 @@ assert(psm->mi == NULL); rc = chroot(ts->rootDir); /*@=unrecog@*/ psm->chrootDone = ts->chrootDone = 1; - if (ts->rpmdb) ts->rpmdb->db_chrootDone = 1; + if (ts->rpmdb != NULL) ts->rpmdb->db_chrootDone = 1; + /*@-onlytrans@*/ chroot_prefix = ts->rootDir; + /*@=onlytrans@*/ } break; case PSM_CHROOT_OUT: @@ -1868,7 +1873,7 @@ assert(psm->mi == NULL); rc = chroot("."); /*@=unrecog@*/ psm->chrootDone = ts->chrootDone = 0; - if (ts->rpmdb) ts->rpmdb->db_chrootDone = 0; + if (ts->rpmdb != NULL) ts->rpmdb->db_chrootDone = 0; chroot_prefix = NULL; (void) chdir(ts->currDir); } diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 7d8cc8d94..2defdc59c 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -706,7 +706,7 @@ int rpmdbOpenAll (/*@null@*/ rpmdb db) * @param name rpm package name * @return number of instances */ -int rpmdbCountPackages(rpmdb db, const char * name) +int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name) /*@modifies db @*/; /** \ingroup rpmdb @@ -876,7 +876,7 @@ int rpmdbSetIteratorModified(/*@null@*/ rpmdbMatchIterator mi, int modified) * @param h header * @return 0 on success */ -int rpmdbAdd(rpmdb db, int iid, Header h) +int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h) /*@modifies db, h, fileSystem @*/; /** \ingroup rpmdb @@ -886,7 +886,7 @@ int rpmdbAdd(rpmdb db, int iid, Header h) * @param offset location in Packages dbi * @return 0 on success */ -int rpmdbRemove(rpmdb db, /*@unused@*/ int rid, unsigned int offset) +int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int offset) /*@modifies db, fileSystem @*/; /** \ingroup rpmdb diff --git a/lib/transaction.c b/lib/transaction.c index d655351e6..4c2d56629 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -14,7 +14,9 @@ #include "misc.h" /* XXX stripTrailingChar, splitString, currentDirectory */ #include "rpmdb.h" +/*@-redecl -exportheadervar@*/ extern const char * chroot_prefix; +/*@=redecl =exportheadervar@*/ /* XXX FIXME: merge with existing (broken?) tests in system.h */ /* portability fiddles */ @@ -1770,7 +1772,9 @@ int rpmRunTransactions( rpmTransactionSet ts, /*@-unrecog@*/ chroot(ts->rootDir); /*@=unrecog@*/ ts->chrootDone = 1; if (ts->rpmdb) ts->rpmdb->db_chrootDone = 1; + /*@-onlytrans@*/ chroot_prefix = ts->rootDir; + /*@=onlytrans@*/ } ht = htCreate(totalFileCount * 2, 0, 0, fpHashFunction, fpEqual); |