projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcffaea
)
num_files: Variable declarations at top of block
author
Aaron Marcher
<me@drkhsh.at>
Mon, 7 May 2018 10:17:13 +0000
(12:17 +0200)
committer
Aaron Marcher
<me@drkhsh.at>
Mon, 7 May 2018 10:17:13 +0000
(12:17 +0200)
components/num_files.c
patch
|
blob
|
history
diff --git
a/components/num_files.c
b/components/num_files.c
index ab43694b1eed21d1c750ad635e222bc73cdeaee8..327a64d621307982638d9f56a0a33aeed704e144 100644
(file)
--- a/
components/num_files.c
+++ b/
components/num_files.c
@@
-11,13
+11,14
@@
num_files(const char *dir)
{
struct dirent *dp;
DIR *fd;
- int num
= 0
;
+ int num;
if (!(fd = opendir(dir))) {
fprintf(stderr, "opendir '%s': %s\n", dir, strerror(errno));
return NULL;
}
+ num = 0;
while ((dp = readdir(fd))) {
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) {
continue; /* skip self and parent */