Date: Fri, 15 Feb 2013 01:27:54 +0000 (UTC) From: Lawrence Stewart <lstewart@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r246816 - projects/diffused_head/sbin/ipfw/diffuse_exporter Message-ID: <201302150127.r1F1Rsdl040173@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lstewart Date: Fri Feb 15 01:27:54 2013 New Revision: 246816 URL: http://svnweb.freebsd.org/changeset/base/246816 Log: Avoid shadowing the global getopt(3) optarg variable. Reported by: clang Modified: projects/diffused_head/sbin/ipfw/diffuse_exporter/diffuse_exporter.c Modified: projects/diffused_head/sbin/ipfw/diffuse_exporter/diffuse_exporter.c ============================================================================== --- projects/diffused_head/sbin/ipfw/diffuse_exporter/diffuse_exporter.c Fri Feb 15 01:25:27 2013 (r246815) +++ projects/diffused_head/sbin/ipfw/diffuse_exporter/diffuse_exporter.c Fri Feb 15 01:27:54 2013 (r246816) @@ -229,13 +229,13 @@ parse_anode(char *s, struct action_node } static void -parse_anodes(char *optarg) +parse_anodes(char *oparg) { struct action_node *tmp_anode; char *anode_str, *x; char *sep = ","; - x = strdup(optarg); + x = strdup(oparg); for (anode_str = strtok(x, sep); anode_str; anode_str = strtok(NULL, sep)) { @@ -250,13 +250,13 @@ parse_anodes(char *optarg) } static void -parse_class(char *optarg, uint32_t *class_ip, uint16_t *class_port) +parse_class(char *oparg, uint32_t *class_ip, uint16_t *class_port) { struct addrinfo *ai, *curai; char *errptr, *p; int ret; - p = strstr(optarg, ":"); + p = strstr(oparg, ":"); if (p != NULL) { *p = '\0'; @@ -266,7 +266,7 @@ parse_class(char *optarg, uint32_t *clas errx(EX_USAGE, "parse error port '%s': %s", p, errptr); } - ret = getaddrinfo(optarg, NULL, NULL, &ai); + ret = getaddrinfo(oparg, NULL, NULL, &ai); if (ret != 0) errx(EX_OSERR, "%s", gai_strerror(ret));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302150127.r1F1Rsdl040173>