with Patch... Re: [BusyBox] Bug in human_readable.c???

Thomas Fröhlich bornland at gmx.at
Mon Sep 1 07:07:51 UTC 2003


Has nobody this bug?
best regards
Thomas

> I use BusyBox v1.00-pre3.
>
> with ls -a I got:
> -rwxr-xr-x    1 0        0         1090552 Aug 28  2003 initall
> -rw-r--r--    1 0        0             365 Aug 28  2003 modules.info
>
> with ls -ah I got:
> -rwxr-xr-x    1 0        0         0 Aug 28  2003 initall
> -rw-r--r--    1 0        0             0 Aug 28  2003 modules.info
>
> with df -h I got:
> Filesystem                Size      Used Available Use% Mounted on
> /dev/root                 0      0      0  23% /
> /dev/mtdblock/3           0      0      0  49% /data
> tmpfs                     0         0      0   0% /dev/shm
> tmpfs                     0         0      0   0% /tmp
>
> with my patch & df -h I got:
> Filesystem                Size      Used Available Use% Mounted on
> /dev/root                 8.0M      1.9M      6.1M  23% /
> /dev/mtdblock/3           8.0M      3.9M      4.1M  49% /data
> tmpfs                     1.4M         0      1.4M   0% /dev/shm
> tmpfs                     1.4M         0      1.4M   0% /tmp
>
> I hope I didn't destroy "report a wrong file size for files larger than
> 4GBtye"-Patch, but I couldn't test it!
>
> regards
> Thomas
>
> PATCH:
> --- include/libbb.h	22 Aug 2003 23:08:37 -0000	1.109
> +++ include/libbb.h	29 Aug 2003 08:31:22 -0000
> @@ -267,7 +267,7 @@
>  	MEGABYTE = (KILOBYTE*1024),
>  	GIGABYTE = (MEGABYTE*1024)
>  };
> -const char *make_human_readable_str(unsigned long long size,
> +const char *make_human_readable_str(unsigned long size,
>  		unsigned long block_size, unsigned long display_unit);
>
>  int bb_ask_confirmation(void);
>
>
> --- libbb/human_readable.c	22 Aug 2003 23:08:36 -0000	1.8
> +++ libbb/human_readable.c	29 Aug 2003 08:31:47 -0000
> @@ -28,8 +28,8 @@
>  #include <stdio.h>
>  #include "libbb.h"
>
> -const char *make_human_readable_str(unsigned long long size,
> -	unsigned long block_size, unsigned long display_unit)
> +const char *make_human_readable_str(unsigned long size,
> +	unsigned long block_size, unsigned long display_unit)
>  {
>  	/* The code will adjust for additional (appended) units. */
>  	static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' }



More information about the busybox mailing list