[hackers] [sbase] Use path[len] instead of *(path + len) || FRIGN
commit f13c489abb4a3d2fbf618f571c9592184f2b4456
Author: FRIGN <dev_AT_frign.de>
Date: Tue Mar 3 00:31:27 2015 +0100
Use path[len] instead of *(path + len)
Maybe it's time to go to bed...
diff --git a/libutil/recurse.c b/libutil/recurse.c
index 295899a..f7b1f61 100644
--- a/libutil/recurse.c
+++ b/libutil/recurse.c
_AT_@ -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);
}
Received on Tue Mar 03 2015 - 14:32:27 CET
This archive was generated by hypermail 2.3.0
: Tue Mar 03 2015 - 14:36:36 CET