Re: [PATCH app/xrandr] Fix checking for valid argument of --dpi

2018-10-18 Thread Pali Rohár
On Thursday 18 October 2018 09:03:27 Giuseppe Bilotta wrote: > Hello, > > On Thu, Apr 12, 2018 at 8:53 PM Pali Rohár wrote: > > - if (++i >= argc) argerr ("%s requires an argument\n", > > argv[i-1]); > > + if (++i >= argc || !argv[i][0]) argerr ("%s requires an > >

Re: [PATCH app/xrandr] Fix checking for valid argument of --dpi

2018-10-18 Thread Giuseppe Bilotta
Hello, On Thu, Apr 12, 2018 at 8:53 PM Pali Rohár wrote: > - if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]); > + if (++i >= argc || !argv[i][0]) argerr ("%s requires an > argument\n", argv[i-1]); I don't think this change is necessary, if arg[i][0] is NULL

Re: [PATCH app/xrandr] Fix checking for valid argument of --dpi

2018-10-17 Thread Pali Rohár
Gentle reminder for a patch which I sent 5 months ago... On Monday 07 May 2018 23:38:10 Pali Rohár wrote: > Hello, can you review my patch below? > > On Thursday 12 April 2018 20:52:21 Pali Rohár wrote: > > Function strtod() sets strtod_error to the pointer of the first invalid > > character and

Re: [PATCH app/xrandr] Fix checking for valid argument of --dpi

2018-05-07 Thread Pali Rohár
Hello, can you review my patch below? On Thursday 12 April 2018 20:52:21 Pali Rohár wrote: > Function strtod() sets strtod_error to the pointer of the first invalid > character and therefore it does not have to be first character from input. > When input is valid then it points to nul byte.

[PATCH app/xrandr] Fix checking for valid argument of --dpi

2018-04-12 Thread Pali Rohár
Function strtod() sets strtod_error to the pointer of the first invalid character and therefore it does not have to be first character from input. When input is valid then it points to nul byte. Conversion error is indicated by setted errno. Zero-length argument and zero DPI is invalid too.