Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : Catch NULL pointers
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Tue, 23 Jun 2009 15:51:19 +0200
  • Message-id: <E1MJ6PG-0008U8-Fa@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 19435f5f292a17090fe493b5ce75cc1132e984db
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Tue Jun 23 15:51:19 2009 +0200

Catch NULL pointers
---
applayer/job.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/applayer/job.c b/applayer/job.c
index 7c6f957..cc7b8af 100644
--- a/applayer/job.c
+++ b/applayer/job.c
@@ -70,12 +70,14 @@ job_relation( const Job *j )
int
job_equal( const Job *job1, const Job *job2 )
{
- if (job1 != job2)
- {
- if (job1->pool != job2->pool
- || job1->cmd != job2->cmd
- || job1->id != job2->id)
- return 0;
- }
- return 1;
+ if (job1
+ && job2
+ && ((job1 == job2)
+ || (job1->pool == job2->pool
+ && job1->cmd == job2->cmd
+ && job1->id == job2->id)
+ )
+ )
+ return 1;
+ return 0;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages