commit 0b9c02cd22507940fe4684e244abda0c714f4d17
parent 903d43bbb85a2846030cdfaae8b6d7597b16a1d6
Author: FRIGN <dev@frign.de>
Date: Tue, 3 Mar 2015 00:31:27 +0100
Use path[len] instead of *(path + len)
Maybe it's time to go to bed...
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libutil/recurse.c b/libutil/recurse.c
@@ -36,8 +36,8 @@ recurse(const char *path, void (*fn)(const char *, int), int depth)
while ((d = readdir(dp))) {
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
continue;
- buf = emalloc(len + (*(path + len) != '/') + strlen(d->d_name) + 1);
- sprintf(buf, "%s%s%s", path, (*(path + len) == '/') ? "" : "/", d->d_name);
+ buf = emalloc(len + (path[len] != '/') + strlen(d->d_name) + 1);
+ sprintf(buf, "%s%s%s", path, (path[len] == '/') ? "" : "/", d->d_name);
fn(buf, depth + 1);
free(buf);
}