diff --git a/src/axel.h b/src/axel.h index 2e28c361..af3df236 100644 --- a/src/axel.h +++ b/src/axel.h @@ -101,7 +101,7 @@ typedef struct { } message_t; typedef message_t url_t; -typedef message_t if_t; +typedef message_t axel_if_t; #include "abuf.h" #include "conf.h" diff --git a/src/conf.c b/src/conf.c index 3f2167ca..73d9838c 100644 --- a/src/conf.c +++ b/src/conf.c @@ -276,7 +276,7 @@ conf_init(conf_t *conf) "User-Agent", DEFAULT_USER_AGENT); conf->add_header_count = HDR_count_init; - conf->interfaces = calloc(1, sizeof(if_t)); + conf->interfaces = calloc(1, sizeof(*conf->interfaces)); if (!conf->interfaces) return 0; @@ -329,11 +329,11 @@ int parse_interfaces(conf_t *conf, char *s) { char *s2; - if_t *iface; + axel_if_t *iface; iface = conf->interfaces->next; while (iface != conf->interfaces) { - if_t *i; + axel_if_t *i; i = iface->next; free(iface); @@ -342,7 +342,7 @@ parse_interfaces(conf_t *conf, char *s) free(conf->interfaces); if (!*s) { - conf->interfaces = calloc(1, sizeof(if_t)); + conf->interfaces = calloc(1, sizeof(*conf->interfaces)); if (!conf->interfaces) return 0; @@ -350,7 +350,7 @@ parse_interfaces(conf_t *conf, char *s) return 1; } - conf->interfaces = iface = malloc(sizeof(if_t)); + conf->interfaces = iface = malloc(sizeof(*iface)); if (!conf->interfaces) return 0; @@ -365,7 +365,7 @@ parse_interfaces(conf_t *conf, char *s) strlcpy(iface->text, s, sizeof(iface->text)); s = s2 + 1; if (*s) { - iface->next = malloc(sizeof(if_t)); + iface->next = malloc(sizeof(*iface)); if (!iface->next) return 0; diff --git a/src/conf.h b/src/conf.h index 74960e2b..d801b3ab 100644 --- a/src/conf.h +++ b/src/conf.h @@ -65,7 +65,7 @@ typedef struct { AXEL_PROGRESS_STYLE_PERCENTAGE, } progress_style; - if_t *interfaces; + axel_if_t *interfaces; sa_family_t ai_family;