/* Teach newbies what subnets are... */
if(((subnet.type == SUBNET_IPV4)
- && !maskcheck(&subnet.net.ipv4.address, subnet.net.ipv4.prefixlength, sizeof subnet.net.ipv4.address))
+ && !maskcheck(&subnet.net.ipv4.address, subnet.net.ipv4.prefixlength, sizeof(subnet.net.ipv4.address)))
|| ((subnet.type == SUBNET_IPV6)
- && !maskcheck(&subnet.net.ipv6.address, subnet.net.ipv6.prefixlength, sizeof subnet.net.ipv6.address))) {
+ && !maskcheck(&subnet.net.ipv6.address, subnet.net.ipv6.prefixlength, sizeof(subnet.net.ipv6.address)))) {
logger(DEBUG_ALWAYS, LOG_ERR, "Network address and prefix length do not match for configuration variable %s in %s line %d",
cfg->variable, cfg->file, cfg->line);
return false;
}
for(;;) {
- line = readline(fp, buffer, sizeof buffer);
+ line = readline(fp, buffer, sizeof(buffer));
if(!line) {
if(feof(fp))
read_config_options(config_tree, NULL);
- snprintf(fname, sizeof fname, "%s" SLASH "tinc.conf", confbase);
+ snprintf(fname, sizeof(fname), "%s" SLASH "tinc.conf", confbase);
errno = 0;
x = read_config_file(config_tree, fname);
// We will try to read the conf files in the "conf.d" dir
if (x) {
char dname[PATH_MAX];
- snprintf(dname, sizeof dname, "%s" SLASH "conf.d", confbase);
+ snprintf(dname, sizeof(dname), "%s" SLASH "conf.d", confbase);
DIR *dir = opendir (dname);
// If we can find this dir
if (dir) {
size_t l = strlen(ep->d_name);
// And we try to read the ones that end with ".conf"
if (l > 5 && !strcmp(".conf", & ep->d_name[ l - 5 ])) {
- snprintf(fname, sizeof fname, "%s" SLASH "%s", dname, ep->d_name);
+ snprintf(fname, sizeof(fname), "%s" SLASH "%s", dname, ep->d_name);
x = read_config_file(config_tree, fname);
}
}
read_config_options(config_tree, name);
- snprintf(fname, sizeof fname, "%s" SLASH "hosts" SLASH "%s", confbase, name);
+ snprintf(fname, sizeof(fname), "%s" SLASH "hosts" SLASH "%s", confbase, name);
x = read_config_file(config_tree, fname);
return x;
bool append_config_file(const char *name, const char *key, const char *value) {
char fname[PATH_MAX];
- snprintf(fname, sizeof fname, "%s" SLASH "hosts" SLASH "%s", confbase, name);
+ snprintf(fname, sizeof(fname), "%s" SLASH "hosts" SLASH "%s", confbase, name);
FILE *fp = fopen(fname, "a");