X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconf.c;h=03887991cdc5bc80908ff124523b3dd3234ba895;hp=4497b0e13ac12990dbb15335ac1916db9267687e;hb=99763e34d52fcfe76b0bb9c7f3a17ace51cfdbfc;hpb=d2f8d0920226e4d8edd3efa3c18b46b783aacea0 diff --git a/src/conf.c b/src/conf.c index 4497b0e1..03887991 100644 --- a/src/conf.c +++ b/src/conf.c @@ -204,7 +204,7 @@ bool get_config_address(const config_t *cfg, struct addrinfo **result) { } bool get_config_subnet(const config_t *cfg, subnet_t **result) { - subnet_t subnet = {}; + subnet_t subnet = {0}; if(!cfg) { return false; @@ -432,7 +432,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 ])) { - if(snprintf(fname, sizeof(fname), "%s/%s", dname, ep->d_name) >= sizeof(fname)) { + if((size_t)snprintf(fname, sizeof(fname), "%s/%s", dname, ep->d_name) >= sizeof(fname)) { logger(LOG_ERR, "Pathname too long: %s/%s", dname, ep->d_name); return false; } @@ -578,7 +578,7 @@ FILE *ask_and_open(const char *filename, const char *what) { /* The directory is a relative path or a filename. */ getcwd(directory, sizeof(directory)); - if(snprintf(abspath, sizeof(abspath), "%s/%s", directory, fn) >= sizeof(abspath)) { + if((size_t)snprintf(abspath, sizeof(abspath), "%s/%s", directory, fn) >= sizeof(abspath)) { fprintf(stderr, "Pathname too long: %s/%s\n", directory, fn); return NULL; }