From 764907187e5416cda9e850ba2c08e4b7b0022f53 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Fri, 21 Sep 2007 09:52:43 +0000 Subject: [PATCH] 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) --- sbin/geom/core/geom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 1b9ea6b208ae..472c659eb6c5 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)