Attention is currently required from: Maximilian Brune.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/78026?usp=email )
Change subject: commonlib: Add skip_atoi() ......................................................................
Patch Set 3:
(2 comments)
Patchset:
PS1:
Its been a while, but I guess that this is what you had in mind?
When I said "move into commonlib" I meant commonlib/bsd, so that you can actually share it with libpayload (unless you want to hide this behind CONFIG_GPL... but for a small utility function like this that seems silly).
Again, I'm not a lawyer but I would still recommend at least reimplementing this with new code to lower the chance of relicensing concerns, e.g. how about this: ``` unsigned int skip_atoi(char **ptr) { unsigned int result = 0;
for (char *str = *ptr; isdigit(str[0]); str++) result = result * 10 + (str[0] - '0');
*ptr = str; } ```
File src/commonlib/string.c:
https://review.coreboot.org/c/coreboot/+/78026/comment/cb4d7e71_e2321fe7 : PS3, Line 2: Needs to include `<ctype.h>` for `isdigit()`. (You could also move all of ctype into commonlib if you want. There's a libpayload version there so licensing shouldn't be an issue. Although I think making them static inlines like coreboot does makes more sense.)