Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.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/trans.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/trans.c')
-rw-r--r--lib/libalpm/trans.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 49fc0f67..c042f099 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -107,7 +107,7 @@ static alpm_list_t *check_arch(alpm_list_t *pkgs)
for(i = pkgs; i; i = i->next) {
pmpkg_t *pkg = i->data;
const char *pkgarch = alpm_pkg_get_arch(pkg);
- if(strcmp(pkgarch,arch) && strcmp(pkgarch,"any")) {
+ if(strcmp(pkgarch,arch) != 0 && strcmp(pkgarch,"any") != 0) {
char *string;
const char *pkgname = alpm_pkg_get_name(pkg);
const char *pkgver = alpm_pkg_get_version(pkg);
@@ -371,7 +371,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
/* either extract or copy the scriptlet */
snprintf(scriptfn, PATH_MAX, "%s/.INSTALL", tmpdir);
- if(!strcmp(script, "pre_upgrade") || !strcmp(script, "pre_install")) {
+ if(strcmp(script, "pre_upgrade") == 0 || strcmp(script, "pre_install") == 0) {
if(_alpm_unpack_single(installfn, tmpdir, ".INSTALL")) {
retval = 1;
}