From 3946a701c0d409dd235f2bcb564b5701beb7d775 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 16 Aug 2015 19:31:46 +0200 Subject: code-style, wrap some lines, etc --- util.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'util.c') 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)) -- cgit v1.2.3