mirror of
https://github.com/opnsense/src.git
synced 2026-04-23 07:07:24 -04:00
backlight: check the lenght if the input before trimming '%'
Reported by: hps Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D26693
This commit is contained in:
parent
4d1308f49b
commit
cf64bfef77
1 changed files with 2 additions and 1 deletions
|
|
@ -145,7 +145,8 @@ main(int argc, char *argv[])
|
|||
|
||||
if (argc == 1) {
|
||||
/* ignore a trailing % for user friendlyness */
|
||||
if (argv[0][strlen(argv[0]) - 1] == '%')
|
||||
if (strlen(argv[0]) > 0 &&
|
||||
argv[0][strlen(argv[0]) - 1] == '%')
|
||||
argv[0][strlen(argv[0]) - 1] = '\0';
|
||||
percent = strtonum(argv[0], 0, 100, &percent_error);
|
||||
if (percent_error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue