Skip to content

Commit d2119d0

Browse files
authored
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 <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #12312
1 parent eb5983e commit d2119d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/libzfs/libzfs_pool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4871,7 +4871,9 @@ zpool_load_compat(const char *compat, boolean_t *features, char *report,
48714871
line != NULL;
48724872
line = strtok_r(NULL, "\n", &ls)) {
48734873
/* discard comments */
4874-
*(strchrnul(line, '#')) = '\0';
4874+
char *r = strchr(line, '#');
4875+
if (r != NULL)
4876+
*r = '\0';
48754877

48764878
for (word = strtok_r(line, ", \t", &ws);
48774879
word != NULL;

0 commit comments

Comments
 (0)