mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
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:
parent
a281f7690d
commit
1ce6d70c52
@ -5369,7 +5369,7 @@ print_zpool_dir_scripts(char *dirpath)
|
|||||||
static void
|
static void
|
||||||
print_zpool_script_list(char *subcommand)
|
print_zpool_script_list(char *subcommand)
|
||||||
{
|
{
|
||||||
char *dir, *sp;
|
char *dir, *sp, *tmp;
|
||||||
|
|
||||||
printf(gettext("Available 'zpool %s -c' commands:\n"), subcommand);
|
printf(gettext("Available 'zpool %s -c' commands:\n"), subcommand);
|
||||||
|
|
||||||
@ -5377,11 +5377,10 @@ print_zpool_script_list(char *subcommand)
|
|||||||
if (sp == NULL)
|
if (sp == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dir = strtok(sp, ":");
|
for (dir = strtok_r(sp, ":", &tmp);
|
||||||
while (dir != NULL) {
|
dir != NULL;
|
||||||
|
dir = strtok_r(NULL, ":", &tmp))
|
||||||
print_zpool_dir_scripts(dir);
|
print_zpool_dir_scripts(dir);
|
||||||
dir = strtok(NULL, ":");
|
|
||||||
}
|
|
||||||
|
|
||||||
free(sp);
|
free(sp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user