summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2014-04-10 01:41:32 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2014-04-10 01:41:32 +0300
commit4d920ad9e4aa344c1600e7419f75f6adb647b1b0 (patch)
tree738e09ff7011b5692cd51730523ad988ca4068b8 /client
parentcff1f37f970adafce1ac3a982ea1d338e609cfed (diff)
downloadbemenu-4d920ad9e4aa344c1600e7419f75f6adb647b1b0.tar.gz
bemenu-4d920ad9e4aa344c1600e7419f75f6adb647b1b0.tar.bz2
bemenu-4d920ad9e4aa344c1600e7419f75f6adb647b1b0.zip
Make asserts and ifs more consistent.
Diffstat (limited to 'client')
-rw-r--r--client/client.c10
1 files changed, 5 insertions, 5 deletions
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;