diff options
author | pjd <pjd@FreeBSD.org> | 2007-09-21 09:52:43 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-09-21 09:52:43 +0000 |
commit | 5f96c6e1c1c73cc84c4ccc580b171863de4c77ee (patch) | |
tree | 09c70ff9fb95524cd921e5d4d4a1a822b1e9fc24 | |
parent | 1f0cbf5a2393fcdc1b29d0dcdbda0fe10bfbb80f (diff) | |
download | FreeBSD-src-5f96c6e1c1c73cc84c4ccc580b171863de4c77ee.zip FreeBSD-src-5f96c6e1c1c73cc84c4ccc580b171863de4c77ee.tar.gz |
Use 'val' function argument instead of 'optarg' global variable.
This doesn't fix any real bug, because in those tw ocases we always
passed 'optarg' as 'val'.
Approved by: re (kensmith)
-rw-r--r-- | sbin/geom/core/geom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 1b9ea6b..472c659 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -225,7 +225,7 @@ set_option(struct gctl_req *req, struct g_option *opt, const char *val) intmax_t number; errno = 0; - number = strtoimax(optarg, NULL, 0); + number = strtoimax(val, NULL, 0); if (errno != 0) { err(EXIT_FAILURE, "Invalid value for '%c' argument.", opt->go_char); @@ -237,7 +237,7 @@ set_option(struct gctl_req *req, struct g_option *opt, const char *val) gctl_ro_param(req, opt->go_name, sizeof(intmax_t), opt->go_val); } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { - gctl_ro_param(req, opt->go_name, -1, optarg); + gctl_ro_param(req, opt->go_name, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { opt->go_val = malloc(sizeof(int)); if (opt->go_val == NULL) |