summaryrefslogtreecommitdiff
path: root/lib/rpmps.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-25 12:39:13 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-25 12:39:13 +0200
commit0ad0e345502c4b261e0c3378fd0830f7eacab340 (patch)
tree271c759b018c8c1b6dfe70f2b1a2f7cd61dbfdbc /lib/rpmps.c
parent48d603e6258219caddc73ba72203596d9ac6bc77 (diff)
downloadlibrpm-tizen-0ad0e345502c4b261e0c3378fd0830f7eacab340.tar.gz
librpm-tizen-0ad0e345502c4b261e0c3378fd0830f7eacab340.tar.bz2
librpm-tizen-0ad0e345502c4b261e0c3378fd0830f7eacab340.zip
Minor cleanup to rpmpsAppendProblem()
- dont bother adding NULL problems - avoid dumb pointer fiddles, ps->probs is just a bleeping array
Diffstat (limited to 'lib/rpmps.c')
-rw-r--r--lib/rpmps.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rpmps.c b/lib/rpmps.c
index 77843b000..acc8ae9f8 100644
--- a/lib/rpmps.c
+++ b/lib/rpmps.c
@@ -134,8 +134,7 @@ rpmps rpmpsFree(rpmps ps)
void rpmpsAppendProblem(rpmps ps, rpmProblem prob)
{
- rpmProblem *p = NULL;
- if (ps == NULL) return;
+ if (ps == NULL || prob == NULL) return;
if (ps->numProblems == ps->numProblemsAlloced) {
if (ps->numProblemsAlloced)
@@ -146,9 +145,8 @@ void rpmpsAppendProblem(rpmps ps, rpmProblem prob)
ps->numProblemsAlloced * sizeof(ps->probs));
}
- p = ps->probs + ps->numProblems;
+ ps->probs[ps->numProblems] = rpmProblemLink(prob);
ps->numProblems++;
- *p = rpmProblemLink(prob);
}
void rpmpsAppend(rpmps ps, rpmProblemType type,