aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/df.c2
-rw-r--r--toys/toysh.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/toys/df.c b/toys/df.c
index f5d27102..cff8584e 100644
--- a/toys/df.c
+++ b/toys/df.c
@@ -71,7 +71,7 @@ static void show_mt(struct mtab_list *mt)
// Figure out how much total/used/free space this filesystem has,
// forcing 64-bit math because filesystems are big now.
- block = mt->statvfs.f_bsize ? : 1;
+ block = mt->statvfs.f_bsize ? mt->statvfs.f_bsize : 1;
size = (long)((block * mt->statvfs.f_blocks) / TT.units);
used = (long)((block * (mt->statvfs.f_blocks-mt->statvfs.f_bfree))
/ TT.units);
diff --git a/toys/toysh.c b/toys/toysh.c
index 23b88c3d..365c47fc 100644
--- a/toys/toysh.c
+++ b/toys/toysh.c
@@ -372,7 +372,7 @@ void toysh_main(void)
for (;;) {
char *command = 0;
if (!f) xputc('$');
- if (1 > getline(&command, &cmdlen, f ? : stdin)) break;
+ if (1 > getline(&command, &cmdlen, f ? f : stdin)) break;
handle(command);
free(command);
}