David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/40325 )
Change subject: Add writeprotect support ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/flashrom/+/40325/6/cli_classic.c File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/40325/6/cli_classic.c@718 PS6, Line 718: start = strtoul(argv[optind], &endptr, 0); : if (errno == ERANGE || errno == EINVAL || *endptr != '\0') { : msg_gerr("Error: value "%s" invalid\n", argv[optind]); : ret = 1; : goto out_shutdown; : } : : len = strtoul(argv[optind + 1], &endptr, 0); : if (errno == ERANGE || errno == EINVAL || *endptr != '\0') { : msg_gerr("Error: value "%s" invalid\n", argv[optind + 1]);
I think we should avoid using `argv[optind]` and `argv[optind + 1]` to get the values here. […]
Yikes... Yeah, this is pretty suspicious. This would be a good time to change the syntax to "--wp-range start,len" if desired, however if that will break a lot of tools that use --wp-range then the first suggestion seems fine too (read the tokens in the OPTION_WP_SET_RANGE case and set optind as needed).