Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/conflict.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-06-19 18:55:08 +1000
committerAllan McRae <allan@archlinux.org>2010-06-21 01:04:58 +1000
commit59c47aaf529df02ec1577fe727c3c84d13592666 (patch)
tree63049bcc89e7058376ce0607ddee116b2f819ddc /lib/libalpm/conflict.c
parentd7dccd541962f0dd8bf323ae11633e595bfb4922 (diff)
Clarify testing within conditional statements
Follow the HACKING guidelines and always use != 0 or == 0 rather than negation within conditional statements to improve clarity. Most of these are !strcmp usages which is the example of what not to do in the HACKING document. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/conflict.c')
-rw-r--r--lib/libalpm/conflict.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index e36844a8..236ec1df 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -88,8 +88,8 @@ int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
char *cpkg2 = conflict->package2;
char *npkg1 = needle->package1;
char *npkg2 = needle->package2;
- if((!strcmp(cpkg1, npkg1) && !strcmp(cpkg2, npkg2))
- || (!strcmp(cpkg1, npkg2) && !strcmp(cpkg2, npkg1))) {
+ if((strcmp(cpkg1, npkg1) == 0 && strcmp(cpkg2, npkg2) == 0)
+ || (strcmp(cpkg1, npkg2) == 0 && strcmp(cpkg2, npkg1) == 0)) {
return(1);
}
}