From 0288b576cabc42c649250dbbfe8bd93f7f3b5e8c Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Sat, 25 Jun 2011 17:02:14 +0100 Subject: include limits.h --- lsx.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lsx.c') diff --git a/lsx.c b/lsx.c index e5b5c0b..bbe57d4 100644 --- a/lsx.c +++ b/lsx.c @@ -1,5 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include +#include #include #include #include -- cgit v1.2.3 From 16a0c0d52aa947b3fe8c9285986567189537d339 Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Thu, 14 Jul 2011 20:03:00 +0100 Subject: fix extra warning --- lsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lsx.c') diff --git a/lsx.c b/lsx.c index bbe57d4..79b506b 100644 --- a/lsx.c +++ b/lsx.c @@ -32,7 +32,7 @@ lsx(const char *dir) { return; } while((d = readdir(dp))) - if(snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name) < sizeof buf + if(snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name) < (ssize_t)sizeof buf && !stat(buf, &st) && S_ISREG(st.st_mode) && access(buf, X_OK) == 0) puts(d->d_name); closedir(dp); -- cgit v1.2.3 From 1636e122101501ddb907119c61d0961ccaa89a99 Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Sun, 17 Jul 2011 14:06:53 +0100 Subject: tweaks --- lsx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lsx.c') diff --git a/lsx.c b/lsx.c index 79b506b..f337a4a 100644 --- a/lsx.c +++ b/lsx.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -32,7 +31,7 @@ lsx(const char *dir) { return; } while((d = readdir(dp))) - if(snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name) < (ssize_t)sizeof buf + if(snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name) < (int)sizeof buf && !stat(buf, &st) && S_ISREG(st.st_mode) && access(buf, X_OK) == 0) puts(d->d_name); closedir(dp); -- cgit v1.2.3