mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +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
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user