From 4d920ad9e4aa344c1600e7419f75f6adb647b1b0 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 10 Apr 2014 01:41:32 +0300 Subject: Make asserts and ifs more consistent. --- client/client.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/client.c b/client/client.c index df56511..973e57a 100644 --- a/client/client.c +++ b/client/client.c @@ -17,22 +17,22 @@ static ptrdiff_t getLine(char **outLine, size_t *outAllocated, FILE *stream) size_t len = 0, allocated; char *s, *buffer; - assert(outLine != NULL); - assert(outAllocated != NULL); + assert(outLine); + assert(outAllocated); - if (stream == NULL || feof(stream) || ferror(stream)) + if (!stream || feof(stream) || ferror(stream)) return -1; allocated = *outAllocated; buffer = *outLine; - if (buffer == NULL || allocated == 0) { + if (!buffer || allocated == 0) { if (!(buffer = calloc(1, (allocated = 1024) + 1))) return -1; } for (s = buffer;;) { - if (fgets(s, allocated - (s - buffer), stream) == NULL) { + if (!fgets(s, allocated - (s - buffer), stream)) { *outAllocated = allocated; *outLine = buffer; return -1; -- cgit v1.2.3-70-g09d2