svn commit: r246816 - projects/diffused_head/sbin/ipfw/diffuse_exporter
Lawrence Stewart
lstewart at FreeBSD.org
Fri Feb 15 01:27:54 UTC 2013
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));
More information about the svn-src-projects
mailing list