diff options
Diffstat (limited to 'lib/libzfs/libzfs_iter.c')
-rw-r--r-- | lib/libzfs/libzfs_iter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libzfs/libzfs_iter.c b/lib/libzfs/libzfs_iter.c index 8215d3cb1..ff76f9f36 100644 --- a/lib/libzfs/libzfs_iter.c +++ b/lib/libzfs/libzfs_iter.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include <stdio.h> @@ -103,7 +103,7 @@ top: int zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) { - zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = {"\0", 0, 0, 0, 0, 0, 0, 0, "\0", "\0", "\0"}; zfs_handle_t *nzhp; int ret; @@ -140,7 +140,7 @@ int zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func, void *data) { - zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = {"\0", 0, 0, 0, 0, 0, 0, 0, "\0", "\0", "\0"}; zfs_handle_t *nzhp; int ret; @@ -306,12 +306,11 @@ int zfs_iter_snapspec(zfs_handle_t *fs_zhp, const char *spec_orig, zfs_iter_f func, void *arg) { - char buf[ZFS_MAXNAMELEN]; - char *comma_separated, *cp; + char *buf, *comma_separated, *cp; int err = 0; int ret = 0; - (void) strlcpy(buf, spec_orig, sizeof (buf)); + buf = zfs_strdup(fs_zhp->zfs_hdl, spec_orig); cp = buf; while ((comma_separated = strsep(&cp, ",")) != NULL) { @@ -369,6 +368,7 @@ zfs_iter_snapspec(zfs_handle_t *fs_zhp, const char *spec_orig, } } + free(buf); return (ret); } |