summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_mntcmds.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-12-12 08:50:21 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-12-12 08:50:21 -0600
commit2977ad09c854e056b26f4ae1d86e751a7acead60 (patch)
treebca07574d034c1ee2bf4bfe0683a9e2139f7e3f2 /apps/nshlib/nsh_mntcmds.c
parente595f53e5bb77d05cb5d981a6fbd613cda5f108f (diff)
downloadnuttx-2977ad09c854e056b26f4ae1d86e751a7acead60.tar.gz
nuttx-2977ad09c854e056b26f4ae1d86e751a7acead60.tar.bz2
nuttx-2977ad09c854e056b26f4ae1d86e751a7acead60.zip
Modified NSH 'df -h' command to do some saner conversions. From Ken Pettit
Diffstat (limited to 'apps/nshlib/nsh_mntcmds.c')
-rw-r--r--apps/nshlib/nsh_mntcmds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c
index b8a97477b..ee242bece 100644
--- a/apps/nshlib/nsh_mntcmds.c
+++ b/apps/nshlib/nsh_mntcmds.c
@@ -194,7 +194,7 @@ static int df_man_readable_handler(FAR const char *mountpoint,
/* Find the label for size */
which = 0;
- while (size >= 1024)
+ while (size >= 9999 || (size & 0x3FF) == 0 && size)
{
which++;
size >>= 10;
@@ -204,7 +204,7 @@ static int df_man_readable_handler(FAR const char *mountpoint,
/* Find the label for free */
which = 0;
- while (free >= 1024)
+ while (free >= 9999 || (free & 0x3FF) == 0 && size)
{
which++;
free >>= 10;
@@ -214,7 +214,7 @@ static int df_man_readable_handler(FAR const char *mountpoint,
/* Find the label for used */
which = 0;
- while (used >= 1024)
+ while (used >= 9999 || (used & 0x3FF) == 0 && size)
{
which++;
used >>= 10;