Alex Thiessen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32901 )
Change subject: string.h: Move common string functions into .c file ......................................................................
Patch Set 1:
(4 comments)
https://review.coreboot.org/#/c/32901/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32901/1//COMMIT_MSG@16 PS1, Line 16: collapsable collapsible
https://review.coreboot.org/#/c/32901/1//COMMIT_MSG@18 PS1, Line 18: Also clarified Also, clarified
https://writing.wisc.edu/handbook/grammarpunct/conjadv
https://review.coreboot.org/#/c/32901/1/src/lib/string.c File src/lib/string.c:
https://review.coreboot.org/#/c/32901/1/src/lib/string.c@50 PS1, Line 50: char *strchr(const char *s, int c) : { : for (; *s; s++) { : if (*s == c) : return (char *)s; : } : return NULL; : } : : char *strrchr(const char *s, int c) : { : char *p = NULL; : : for (; *s; s++) : if (*s == c) : p = (char *)s; : : return p; : } These two seem wrong. If `c` is 0, then pointer to the terminating zero must be returned, instead NULL would be returned.
https://review.coreboot.org/#/c/32901/1/src/lib/string.c@72 PS1, Line 72: register char *ret = to; : register char data; `register` is an anachronism, better just drop it