Re: [PATCH] beep: fix division by zero when -f 0 is passed

tito via busybox <[email protected]> Tue, 26 May 2026 21:12:20 +0200
Newsgroups gmane.linux.busybox
Message-ID <20260526211220.4e90e6cb@devuan>
On Tue, 26 May 2026 12:00:02 -0400
Jody Bruchon via busybox <[email protected]> wrote:

> On 2026-05-26 8:01 AM, tito via busybox wrote:
> > On Tue, 26 May 2026 11:14:48 +0300
> > Anton Moryakov via busybox <[email protected]> wrote:
> > +				if (freq < 20 || freq > 50000)
> 
> Why these arbitrary numbers? Just do a simple zero check. If I want the 
> speaker to make a pop at 1 Hz, I should be able to make it pop at 1 Hz. 
> Also, 50 kHz is way beyond the abilities of human hearing. Anything 
> other than if (freq == 0) error(); is bloat.

man beep:

      -f FREQ
              Beep  with a tone frequency of FREQ Hz, where 0 < FREQ < 20000.  As a general ballpark, the regular terminal 
               beep is around 750Hz.  For backwards compatibility, you can give FREQ as a floating point number, but beep will
              round that to integer values as the kernel APIs expect them.  Default value: 440 Hz.


Ciao,
Tito