zpool: print_zpool_script_list: remove strtok

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12094
This commit is contained in:
наб 2021-05-20 23:07:23 +02:00 committed by Brian Behlendorf
parent a281f7690d
commit 1ce6d70c52

View File

@ -5369,7 +5369,7 @@ print_zpool_dir_scripts(char *dirpath)
static void
print_zpool_script_list(char *subcommand)
{
char *dir, *sp;
char *dir, *sp, *tmp;
printf(gettext("Available 'zpool %s -c' commands:\n"), subcommand);
@ -5377,11 +5377,10 @@ print_zpool_script_list(char *subcommand)
if (sp == NULL)
return;
dir = strtok(sp, ":");
while (dir != NULL) {
for (dir = strtok_r(sp, ":", &tmp);
dir != NULL;
dir = strtok_r(NULL, ":", &tmp))
print_zpool_dir_scripts(dir);
dir = strtok(NULL, ":");
}
free(sp);
}