code-style: fix consistency issues all over the codebase (#94)

* remove duplicate comment
* remove empty tabs and blank lines
* move macros and globals ontop
* comment to seprate function implementation
* fix alignment
* switch to *argv[] similar to other suckless code
* kill all empty last lines
* append comment to endif
* reuse existing ARRLEN macro
* comment fall through
* use while (true) everywhere

Co-authored-by: NRK <nrk@disroot.org>
This commit is contained in:
Berke Kocaoğlu
2021-10-11 06:07:18 +03:00
committed by GitHub
parent 675db4bbb6
commit 1449bfc5e9
11 changed files with 45 additions and 68 deletions

5
util.c
View File

@ -30,7 +30,7 @@ const char *progname;
void* emalloc(size_t size)
{
void *ptr;
ptr = malloc(size);
if (ptr == NULL)
error(EXIT_FAILURE, errno, NULL);
@ -172,7 +172,7 @@ char* r_readdir(r_dir_t *rdir, bool skip_dotfiles)
}
return filename;
}
if (rdir->recursive && rdir->stlen > 0) {
/* open next subdirectory */
closedir(rdir->dir);
@ -210,4 +210,3 @@ int r_mkdir(char *path)
}
return 0;
}