summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/boom.c4
-rw-r--r--src/rij.c1
-rw-r--r--src/toilet.c3
3 files changed, 4 insertions, 4 deletions
diff --git a/src/boom.c b/src/boom.c
index 14f3250..9611e55 100644
--- a/src/boom.c
+++ b/src/boom.c
@@ -108,8 +108,8 @@ static int f(const char *fpath, const struct stat *, int typeflag, struct FTW *f
printf("%s", fname);
if (typeflag == FTW_SL) {
char real_name[PATH_MAX] = {0};
- readlink(fpath, real_name, PATH_MAX-1);
- printf(" -> %s", real_name);
+ if (readlink(fpath, real_name, PATH_MAX-1) != -1)
+ printf(" -> %s", real_name);
}
printf("\n");
diff --git a/src/rij.c b/src/rij.c
index 1803cdd..4215fe2 100644
--- a/src/rij.c
+++ b/src/rij.c
@@ -74,6 +74,7 @@ int entry_rij(int argc, char **argv) {
case 1: start = step = 1; end = argnums[0]; break;
case 2: start = argnums[0]; step = 1; end = argnums[1]; break;
case 3: start = argnums[0]; step = argnums[1]; end = argnums[2]; break;
+ default: __builtin_unreachable();
}
const long long safeend = end == LLONG_MAX ? LLONG_MAX - 1 : end;
diff --git a/src/toilet.c b/src/toilet.c
index ae731c4..6339599 100644
--- a/src/toilet.c
+++ b/src/toilet.c
@@ -73,7 +73,7 @@ static char** parse_options(int argc, char **argv, int *modeMap) {
return argv + optind;
}
-size_t get_count(enum MODE mode, struct filebuf *fb) {
+static size_t get_count(enum MODE mode, struct filebuf *fb) {
switch (mode) {
case M_BYTES:
return fb->sz;
@@ -81,7 +81,6 @@ size_t get_count(enum MODE mode, struct filebuf *fb) {
case M_WORDS: {
size_t words = 0;
- assert(fb->sz >= 0);
// (c) Tom Forging
for (size_t i = 0; i < (size_t)fb->sz;) {
size_t previ = i;