diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-08-16 19:31:46 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-08-16 19:31:46 +0200 |
commit | 3946a701c0d409dd235f2bcb564b5701beb7d775 (patch) | |
tree | 1b9a3cc10ac6a269d81be4d543cd13201ae46949 /util.c | |
parent | 42a1ceb58acc58ade796fa66eeed4bd8fd5901ec (diff) |
code-style, wrap some lines, etc
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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)) |