aboutsummaryrefslogtreecommitdiff
path: root/ls.c
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-05-27 09:17:43 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-05-27 09:21:28 +1200
commitcb7abfb92d2c1fba40c686f28ab55f8a8fa931eb (patch)
tree5242cc6a3b130872282b7cb2c75dd848bd81805f /ls.c
parentSimplify types for sort func (diff)
downloadtunics-cb7abfb92d2c1fba40c686f28ab55f8a8fa931eb.tar.gz
tunics-cb7abfb92d2c1fba40c686f28ab55f8a8fa931eb.zip
Use implicit NULL tests
Diffstat (limited to 'ls.c')
-rw-r--r--ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ls.c b/ls.c
index fbd05be..aabb305 100644
--- a/ls.c
+++ b/ls.c
@@ -12,13 +12,13 @@ int main(int argc, char **argv)
dirname = ".";
}
- if ((dir = opendir(dirname)) == NULL) {
+ if (!(dir = opendir(dirname))) {
perror("opendir");
free(dir);
exit(EXIT_FAILURE);
}
- while ((dirent = readdir(dir)) != NULL) {
+ while ((dirent = readdir(dir))) {
fprintf(stdout, "%s\n", dirent->d_name);
}
if (errno) {