do not use pointers as truth values Reference: /n/atom/patch/applied/nedptrcmp Date: Wed May 21 22:45:47 CES 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/upas/ned/nedmail.c Wed May 21 22:45:47 2014 +++ /sys/src/cmd/upas/ned/nedmail.c Wed May 21 22:45:47 2014 @@ -604,7 +604,7 @@ highest = last->fileno; for(i = highest + 1;; i++){ snprint(buf, sizeof buf, "%s/%d", parent->path, i); - if(!(d = dirstat(buf))) + if((d = dirstat(buf)) == nil) break; if((d->qid.type & QTDIR) == 0){ free(d); @@ -2361,7 +2361,7 @@ char *av[128], *rpath, *subject, *from, *to, *cc; int i, ai; - if(!m->from || !m->to || !m->cc){ + if(m->from == nil || m->to == nil || m->cc == nil){ eprint("!bad message\n"); return nil; } @@ -2694,7 +2694,7 @@ char *p; p = strrchr(s, c); - if(p && p > s) { + if(p != nil && p > s) { *p = 0; return p - 1; }