om

om - the most recently modified file in a directory
git clone git://git.larryhynes.net/om
Log | Files | Refs | README | LICENSE

commit fdcb3c5faba6549dfc0fa1cbd42900967185c1a7
parent f0e0424d81fd0bfedb2ba6978031e156fbc74e41
Author: Larry Hynes <larry@larryhynes.com>
Date:   Tue,  4 Jul 2017 13:01:20 +0100

Do Things Right, correctly

- Evaluate len consistently for strlcat

A schoolboy error in my application of strlcat, resulting from
enthusiasm to Get It Done.

Diffstat:
om.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/om.c b/om.c @@ -61,10 +61,10 @@ om() len = strlcpy(buf, dir, sizeof(buf)); if (len >= sizeof(buf)) serr(); - strlcat(buf, "/", sizeof(buf)); + len = strlcat(buf, "/", sizeof(buf)); if (len >= sizeof(buf)) serr(); - strlcat(buf, ent->d_name, sizeof(buf)); + len = strlcat(buf, ent->d_name, sizeof(buf)); if (len >= sizeof(buf)) serr();