Tweak NULL-pointer checks
Use !p and p when comparing pointers as opposed to explicit checks against NULL. This is generally easier to read.
This commit is contained in:
@@ -17,7 +17,7 @@ getlines(FILE *fp, struct linebuf *b)
|
||||
if (++b->nlines > b->capacity) {
|
||||
b->capacity += 512;
|
||||
nline = realloc(b->lines, b->capacity * sizeof(*b->lines));
|
||||
if (nline == NULL)
|
||||
if (!nline)
|
||||
eprintf("realloc:");
|
||||
b->lines = nline;
|
||||
}
|
||||
|
Reference in New Issue
Block a user