mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Replace strchrnul() with strrchr()
Could have gone either way with this one, either adding it to macOS/Windows SPL, or returning it to "classic" usage with strrchr(). Since the new special way isn't really used, and only used once, we have this commit. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes #12312
This commit is contained in:
parent
eb5983e1b7
commit
d2119d0e6f
@ -4871,7 +4871,9 @@ zpool_load_compat(const char *compat, boolean_t *features, char *report,
|
||||
line != NULL;
|
||||
line = strtok_r(NULL, "\n", &ls)) {
|
||||
/* discard comments */
|
||||
*(strchrnul(line, '#')) = '\0';
|
||||
char *r = strchr(line, '#');
|
||||
if (r != NULL)
|
||||
*r = '\0';
|
||||
|
||||
for (word = strtok_r(line, ", \t", &ws);
|
||||
word != NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user