projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tree wide: Replace sstrerror() with STRERROR().
[collectd.git]
/
src
/
iptables.c
diff --git
a/src/iptables.c
b/src/iptables.c
index
1d127bf
..
2dddacc
100644
(file)
--- a/
src/iptables.c
+++ b/
src/iptables.c
@@
-113,8
+113,7
@@
static int iptables_config(const char *key, const char *value) {
value_copy = strdup(value);
if (value_copy == NULL) {
value_copy = strdup(value);
if (value_copy == NULL) {
- char errbuf[1024];
- ERROR("strdup failed: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("strdup failed: %s", STRERRNO);
return 1;
}
return 1;
}
@@
-182,8
+181,7
@@
static int iptables_config(const char *key, const char *value) {
list = realloc(chain_list, (chain_num + 1) * sizeof(ip_chain_t *));
if (list == NULL) {
list = realloc(chain_list, (chain_num + 1) * sizeof(ip_chain_t *));
if (list == NULL) {
- char errbuf[1024];
- ERROR("realloc failed: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("realloc failed: %s", STRERRNO);
sfree(temp.rule.comment);
return 1;
}
sfree(temp.rule.comment);
return 1;
}
@@
-191,8
+189,7
@@
static int iptables_config(const char *key, const char *value) {
chain_list = list;
final = malloc(sizeof(* final));
if (final == NULL) {
chain_list = list;
final = malloc(sizeof(* final));
if (final == NULL) {
- char errbuf[1024];
- ERROR("malloc failed: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("malloc failed: %s", STRERRNO);
sfree(temp.rule.comment);
return 1;
}
sfree(temp.rule.comment);
return 1;
}
@@
-226,8
+223,8
@@
static int submit6_match(const struct ip6t_entry_match *match,
sstrncpy(vl.plugin, "ip6tables", sizeof(vl.plugin));
sstrncpy(vl.plugin, "ip6tables", sizeof(vl.plugin));
- status = s
s
nprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%s-%s",
-
chain->table, chain->chain);
+ status = snprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%s-%s",
+ chain->table, chain->chain);
if ((status < 1) || ((unsigned int)status >= sizeof(vl.plugin_instance)))
return 0;
if ((status < 1) || ((unsigned int)status >= sizeof(vl.plugin_instance)))
return 0;
@@
-235,8
+232,8
@@
static int submit6_match(const struct ip6t_entry_match *match,
sstrncpy(vl.type_instance, chain->name, sizeof(vl.type_instance));
} else {
if (chain->rule_type == RTYPE_NUM)
sstrncpy(vl.type_instance, chain->name, sizeof(vl.type_instance));
} else {
if (chain->rule_type == RTYPE_NUM)
- s
s
nprintf(vl.type_instance, sizeof(vl.type_instance), "%i",
-
chain->rule.num);
+ snprintf(vl.type_instance, sizeof(vl.type_instance), "%i",
+ chain->rule.num);
else
sstrncpy(vl.type_instance, (char *)match->data, sizeof(vl.type_instance));
}
else
sstrncpy(vl.type_instance, (char *)match->data, sizeof(vl.type_instance));
}
@@
-274,8
+271,8
@@
static int submit_match(const struct ipt_entry_match *match,
sstrncpy(vl.plugin, "iptables", sizeof(vl.plugin));
sstrncpy(vl.plugin, "iptables", sizeof(vl.plugin));
- status = s
s
nprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%s-%s",
-
chain->table, chain->chain);
+ status = snprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%s-%s",
+ chain->table, chain->chain);
if ((status < 1) || ((unsigned int)status >= sizeof(vl.plugin_instance)))
return 0;
if ((status < 1) || ((unsigned int)status >= sizeof(vl.plugin_instance)))
return 0;
@@
-283,8
+280,8
@@
static int submit_match(const struct ipt_entry_match *match,
sstrncpy(vl.type_instance, chain->name, sizeof(vl.type_instance));
} else {
if (chain->rule_type == RTYPE_NUM)
sstrncpy(vl.type_instance, chain->name, sizeof(vl.type_instance));
} else {
if (chain->rule_type == RTYPE_NUM)
- s
s
nprintf(vl.type_instance, sizeof(vl.type_instance), "%i",
-
chain->rule.num);
+ snprintf(vl.type_instance, sizeof(vl.type_instance), "%i",
+ chain->rule.num);
else
sstrncpy(vl.type_instance, (char *)match->data, sizeof(vl.type_instance));
}
else
sstrncpy(vl.type_instance, (char *)match->data, sizeof(vl.type_instance));
}