aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r--lib/libzfs/libzfs_pool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index c0bf9d067..7338b9d72 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -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;