From 0b9c02cd22507940fe4684e244abda0c714f4d17 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Tue, 3 Mar 2015 00:31:27 +0100 Subject: [PATCH] Use path[len] instead of *(path + len) Maybe it's time to go to bed... --- libutil/recurse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libutil/recurse.c b/libutil/recurse.c index 295899a..f7b1f61 100644 --- 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); }