summaryrefslogtreecommitdiff
path: root/legacy/evil
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-08-21 13:52:25 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2010-08-21 13:52:25 +0000
commit5a8a8c90140aa18bde2c1696eb7d2da1c978e15e (patch)
treeb9d11055f743cd53a3895501ed9a6203062bbe60 /legacy/evil
parent8b3511109441c22a2664665efe00892dc44fcf6c (diff)
Convert (hopefully) all comparisons to NULL
Apply badzero.cocci, badnull.coci and badnull2.cocci This should convert all cases where there's a comparison to NULL to simpler forms. This patch applies the following transformations: code before patch ||code after patch =============================================================== return a == NULL; return !a; return a != NULL; return !!a; func(a == NULL); func(!a); func(a != NULL); func(!!a); b = a == NULL; b = !a; b = a != NULL; b = !!a; b = a == NULL ? c : d; b = !a ? c : d; b = a != NULL ? c : d; b = a ? c : d; other cases: a == NULL !a a != NULL a SVN revision: 51487
Diffstat (limited to 'legacy/evil')
-rw-r--r--legacy/evil/src/lib/evil_langinfo.c4
-rw-r--r--legacy/evil/src/lib/evil_pwd.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/legacy/evil/src/lib/evil_langinfo.c b/legacy/evil/src/lib/evil_langinfo.c
index 9632b7b139..560f6adf8f 100644
--- a/legacy/evil/src/lib/evil_langinfo.c
+++ b/legacy/evil/src/lib/evil_langinfo.c
@@ -10,7 +10,7 @@
10static char * 10static char *
11replace(char *prev, char *value) 11replace(char *prev, char *value)
12{ 12{
13 if (value == NULL) 13 if (!value)
14 return prev; 14 return prev;
15 15
16 if (prev) 16 if (prev)
@@ -30,7 +30,7 @@ nl_langinfo(nl_item index)
30 { 30 {
31 char *p; 31 char *p;
32 result = replace(result, setlocale(LC_CTYPE, NULL)); 32 result = replace(result, setlocale(LC_CTYPE, NULL));
33 if ((p = strrchr(result, '.' )) == NULL) 33 if (!(p = strrchr(result, '.')))
34 return nothing; 34 return nothing;
35 35
36 if ((++p - result) > 2) 36 if ((++p - result) > 2)
diff --git a/legacy/evil/src/lib/evil_pwd.c b/legacy/evil/src/lib/evil_pwd.c
index 9b50facc07..0830b5b26a 100644
--- a/legacy/evil/src/lib/evil_pwd.c
+++ b/legacy/evil/src/lib/evil_pwd.c
@@ -56,7 +56,7 @@ getpwuid (uid_t uid)
56 pw.pw_gecos = (res ? user_name : NULL); 56 pw.pw_gecos = (res ? user_name : NULL);
57 pw.pw_dir = (char *)evil_homedir_get(); 57 pw.pw_dir = (char *)evil_homedir_get();
58 pw.pw_shell = getenv("SHELL"); 58 pw.pw_shell = getenv("SHELL");
59 if (pw.pw_shell == NULL) 59 if (!pw.pw_shell)
60 pw.pw_shell = "sh"; 60 pw.pw_shell = "sh";
61 pw.pw_expire = 0; 61 pw.pw_expire = 0;
62 pw.pw_fields = 0; 62 pw.pw_fields = 0;