bad print in hdparm.c

walter harms wharms at bfs.de
Wed May 20 10:14:01 UTC 2009



Mike Frysinger schrieb:
> On Wednesday 20 May 2009 04:53:00 Mikhail Gusarov wrote:
>> Twas brillig at 04:51:29 20.05.2009 UTC-04 when vapier at gentoo.org did gyre 
> and gimble:
>>  >> >printf("%u minutes %u seconds", standby / 12, (standby*5) % 60);
>>  >>
>>  >> <printf("%u minutes %u seconds", standby / 12, standby % 12);
>>
>>  MF> better to write it as (60 / 5) so people dont get confused as to
>>  MF> where this magic 12 is coming from
>>
>> why not standby / (60 / 5) then? :)
> 
> i would agree with that change as well
> -mike


no problem with me either :) i only notice now we have "both" world.

perhaps a defince can make it even more readable ?

#define 5SECONDS  (60/5)    // 5 Seconds in Minutes
printf("%u minutes %u seconds", standby / 5SECONDS, standby % 5SECONDS);

re,
 wh




More information about the busybox mailing list