aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorjavad <uidopsu@gmail.com>2021-10-24 01:27:22 +0330
committerNRK <nrk@disroot.org>2021-10-24 06:41:17 +0600
commitbbebd45ce614fc0297ed53bcda04a49a0cb292b6 (patch)
tree8c9107a188b8bc6484e7bb9601b92161f4394c96 /util.c
parent7b08b0a31b6bf5e4644ad075016feca59368ba2d (diff)
code-style: remove extra casts (#130)
Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util.c b/util.c
index 6028eb7..8cc4d4e 100644
--- a/util.c
+++ b/util.c
@@ -100,7 +100,7 @@ int r_opendir(r_dir_t *rdir, const char *dirname, bool recursive)
}
rdir->stcap = 512;
- rdir->stack = (char**) emalloc(rdir->stcap * sizeof(char*));
+ rdir->stack = emalloc(rdir->stcap * sizeof(char*));
rdir->stlen = 0;
rdir->name = (char*) dirname;
@@ -153,7 +153,7 @@ char* r_readdir(r_dir_t *rdir, bool skip_dotfiles)
}
len = strlen(rdir->name) + strlen(dentry->d_name) + 2;
- filename = (char*) emalloc(len);
+ filename = emalloc(len);
snprintf(filename, len, "%s%s%s", rdir->name,
rdir->name[strlen(rdir->name)-1] == '/' ? "" : "/",
dentry->d_name);
@@ -164,8 +164,8 @@ char* r_readdir(r_dir_t *rdir, bool skip_dotfiles)
/* put subdirectory on the stack */
if (rdir->stlen == rdir->stcap) {
rdir->stcap *= 2;
- rdir->stack = (char**) erealloc(rdir->stack,
- rdir->stcap * sizeof(char*));
+ rdir->stack = erealloc(rdir->stack,
+ rdir->stcap * sizeof(char*));
}
rdir->stack[rdir->stlen++] = filename;
continue;