[alsa-devel] [PATCH 1/1] seq: arecordmidi: Add num-events option

Takashi Sakamoto o-takashi at sakamocchi.jp
Tue Jan 29 04:36:06 CET 2019


Hi,

On 2019/01/29 10:44, pmalani at chromium.org wrote:
> @@ -775,6 +780,11 @@ int main(int argc, char *argv[])
> +		case 'n':
> +			num_events = atoi(optarg);
> +			if (num_events <= 0)
> +				fatal("num_events must be greater than 0");
> +			break;

We cannot distinguish two cases; 0 is given and including non-numeraical
characters. Please use strtol() or so and check return value and errno
for safe.

For your information:
http://git.alsa-project.org/?p=alsa-utils.git;a=blob;f=axfer/main.c;hb=HEAD#l44


Regards

Takashi Sakamoto


More information about the Alsa-devel mailing list