bad print in hdparm.c

walter harms wharms at bfs.de
Wed May 20 08:43:39 UTC 2009



Amir Rapson schrieb:
> A wrong print out when setting spin down timeout using hdparm:
> 
> diff -Nuar busybox-1.13.3/miscutils/hdparm.c
> busybox-1.13.3.new/miscutils/hdparm.c
> --- busybox-1.13.3/miscutils/hdparm.c   2009-02-26 13:47:23.000000000 +0200
> +++ busybox-1.13.3.new/miscutils/hdparm.c   2009-05-20 11:02:38.000000000
> +0300
> @@ -1453,7 +1453,7 @@
>         printf("%u minutes %u seconds", standby / 12, (standby*5) % 60);
>     } else if (standby <= 251) {
>         unsigned t = (standby - 240); /* t is in 30 min units */;
> -       printf("%u.%c hours", t / 2, (t & 1) ? '0' : '5');
> +       printf("%u.%c hours", t / 2, (t & 1) ? '5' : '0');
>     }
>     if (standby == 253)
>         printf("vendor-specific");
> 
> 
maybe you can reduce this also ?
>printf("%u minutes %u seconds", standby / 12, (standby*5) % 60);
<printf("%u minutes %u seconds", standby / 12, standby % 12);

re,
 wh


More information about the busybox mailing list