summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-08-16 19:31:46 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-08-16 19:31:46 +0200
commit3946a701c0d409dd235f2bcb564b5701beb7d775 (patch)
tree1b9a3cc10ac6a269d81be4d543cd13201ae46949 /util.c
parent42a1ceb58acc58ade796fa66eeed4bd8fd5901ec (diff)
code-style, wrap some lines, etc
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/util.c b/util.c
index a2d7f28..05d0453 100644
--- a/util.c
+++ b/util.c
@@ -71,7 +71,9 @@ readpath:
return -1;
}
/* treat truncation as an error */
- return strlcat(u->path, p, sizeof(u->path)) >= sizeof(u->path) ? -1 : 0;
+ if (strlcat(u->path, p, sizeof(u->path)) >= sizeof(u->path))
+ return -1;
+ return 0;
}
/* Get absolute uri; if `link` is relative use `base` to make it absolute.
@@ -115,9 +117,9 @@ absuri(const char *link, const char *base, char *buf, size_t bufsiz)
if (i >= sizeof(tmp))
return -1;
}
- } else {
- if (strlcat(tmp, ubase.path, sizeof(tmp)) >= sizeof(tmp))
- return -1;
+ } else if (strlcat(tmp, ubase.path, sizeof(tmp)) >=
+ sizeof(tmp)) {
+ return -1;
}
}
if (strlcat(tmp, ulink.path, sizeof(tmp)) >= sizeof(tmp))