diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-08-11 20:35:26 +0000 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-08-11 20:35:26 +0000 |
commit | 13d2d20efa6d7eb1b1e49faadf57f9a65f359bfc (patch) | |
tree | 3e6a7499c00e1f01e698b78307f58a97aa974600 /legacy/embryo/src/lib/embryo_str.c | |
parent | d4bf64d1c24c01b59125fbc6c4954cbe84a696c7 (diff) |
Remove comparisons to NULL
Rather than using "== NULL" or "!= NULL", use expression or !expression where
possible.
Patch automatically generated by coccinelle from badnull.cocci and
badnull2.cocci
SVN revision: 51023
Diffstat (limited to '')
-rw-r--r-- | legacy/embryo/src/lib/embryo_str.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/legacy/embryo/src/lib/embryo_str.c b/legacy/embryo/src/lib/embryo_str.c index f02202194d..cd3b942010 100644 --- a/legacy/embryo/src/lib/embryo_str.c +++ b/legacy/embryo/src/lib/embryo_str.c | |||
@@ -425,7 +425,7 @@ _embryo_str_strstr(Embryo_Program *ep, Embryo_Cell *params) | |||
425 | STRGET(ep, s2, params[2]); | 425 | STRGET(ep, s2, params[2]); |
426 | if ((!s1) || (!s2)) return -1; | 426 | if ((!s1) || (!s2)) return -1; |
427 | p = strstr(s1, s2); | 427 | p = strstr(s1, s2); |
428 | if (p == NULL) return -1; | 428 | if (!p) return -1; |
429 | return (Embryo_Cell)(p - s1); | 429 | return (Embryo_Cell)(p - s1); |
430 | } | 430 | } |
431 | 431 | ||
@@ -440,7 +440,7 @@ _embryo_str_strchr(Embryo_Program *ep, Embryo_Cell *params) | |||
440 | STRGET(ep, s1, params[1]); | 440 | STRGET(ep, s1, params[1]); |
441 | STRGET(ep, s2, params[2]); | 441 | STRGET(ep, s2, params[2]); |
442 | p = strchr(s1, s2[0]); | 442 | p = strchr(s1, s2[0]); |
443 | if (p == NULL) return -1; | 443 | if (!p) return -1; |
444 | return (Embryo_Cell)(p - s1); | 444 | return (Embryo_Cell)(p - s1); |
445 | } | 445 | } |
446 | 446 | ||
@@ -455,7 +455,7 @@ _embryo_str_strrchr(Embryo_Program *ep, Embryo_Cell *params) | |||
455 | STRGET(ep, s1, params[1]); | 455 | STRGET(ep, s1, params[1]); |
456 | STRGET(ep, s2, params[2]); | 456 | STRGET(ep, s2, params[2]); |
457 | p = strrchr(s1, s2[0]); | 457 | p = strrchr(s1, s2[0]); |
458 | if (p == NULL) return -1; | 458 | if (!p) return -1; |
459 | return (Embryo_Cell)(p - s1); | 459 | return (Embryo_Cell)(p - s1); |
460 | } | 460 | } |
461 | 461 | ||