Commit Graph

9 Commits

Author SHA1 Message Date
FRIGN 93fd817536 Add estrlcat() and estrlcpy()
It has become a common idiom in sbase to check strlcat() and strlcpy()
using

if (strl{cat, cpy}(dst, src, siz) >= siz)
        eprintf("path too long\n");

However, this was not carried out consistently and to this very day,
some tools employed unchecked calls to these functions, effectively
allowing silent truncations to happen, which in turn may lead to
security issues.
To finally put an end to this, the e*-functions detect truncation
automatically and the caller can lean back and enjoy coding without
trouble. :)
2015-03-17 11:24:49 +01:00
FRIGN 0c2f19c210 Audit logger(1)
1) Update manpage to current style
2) Line spacing
3) Local variable grouping
4) check for getline >= 0 instead of != -1
5) error message cleanup
2015-03-07 00:10:22 +01:00
sin 71de7813c0 Include strings.h for strcasecmp()
Fixes another build error on NetBSD.
2015-02-20 16:00:58 +00:00
Hiltjo Posthuma 31f0624f3d code-style: minor cleanup and nitpicking 2015-02-20 13:29:38 +01:00
FRIGN 31572c8b0e Clean up #includes 2015-02-14 21:12:23 +01:00
sin 7e8fcc1f03 logger: Don't bother freeing buf
There are many more instances of this pattern.
2014-12-16 20:14:40 +00:00
sin 296af80dba Factor out table walk into a separate function 2014-12-09 15:51:21 +00:00
sin 95c9b4b255 Staticise functions in logger(1) 2014-12-04 11:46:11 +00:00
sin 5d1e46fefa Implement POSIX 2008 compliant logger(1) 2014-12-04 11:36:40 +00:00