projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent sptps_test from sending overly large UDP packets.
[tinc]
/
src
/
conf.c
diff --git
a/src/conf.c
b/src/conf.c
index
5706570
..
a33bdfe
100644
(file)
--- a/
src/conf.c
+++ b/
src/conf.c
@@
-80,18
+80,9
@@
config_t *new_config(void) {
}
void free_config(config_t *cfg) {
}
void free_config(config_t *cfg) {
- if(cfg->variable) {
- free(cfg->variable);
- }
-
- if(cfg->value) {
- free(cfg->value);
- }
-
- if(cfg->file) {
- free(cfg->file);
- }
-
+ free(cfg->variable);
+ free(cfg->value);
+ free(cfg->file);
free(cfg);
}
free(cfg);
}
@@
-203,7
+194,7
@@
bool get_config_address(const config_t *cfg, struct addrinfo **result) {
}
bool get_config_subnet(const config_t *cfg, subnet_t **result) {
}
bool get_config_subnet(const config_t *cfg, subnet_t **result) {
- subnet_t subnet = {
NULL
};
+ subnet_t subnet = {
0
};
if(!cfg) {
return false;
if(!cfg) {
return false;
@@
-433,7
+424,7
@@
bool read_server_config(void) {
// And we try to read the ones that end with ".conf"
if(l > 5 && !strcmp(".conf", & ep->d_name[ l - 5 ])) {
// And we try to read the ones that end with ".conf"
if(l > 5 && !strcmp(".conf", & ep->d_name[ l - 5 ])) {
- if(snprintf(fname, sizeof(fname), "%s" SLASH "%s", dname, ep->d_name) >= sizeof(fname)) {
+ if(
(size_t)
snprintf(fname, sizeof(fname), "%s" SLASH "%s", dname, ep->d_name) >= sizeof(fname)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Pathname too long: %s/%s", dname, ep->d_name);
return false;
}
logger(DEBUG_ALWAYS, LOG_ERR, "Pathname too long: %s/%s", dname, ep->d_name);
return false;
}