diff --git a/activity_monitor.c b/activity_monitor.c index 697bec95..ad0c528f 100644 --- a/activity_monitor.c +++ b/activity_monitor.c @@ -170,7 +170,6 @@ void *activity_monitor_thread_code(void *arg) { uint64_t sec; uint64_t nsec; - int rc; struct timespec time_for_wait; state = am_inactive; diff --git a/common.c b/common.c index d8be92a4..6bd31524 100644 --- a/common.c +++ b/common.c @@ -450,7 +450,7 @@ char *base64_enc(uint8_t *input, int length) { b64 = BIO_push(b64, bmem); BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); BIO_write(b64, input, length); - BIO_flush(b64); + (void) BIO_flush(b64); BIO_get_mem_ptr(b64, &bptr); char *buf = (char *)malloc(bptr->length); @@ -482,7 +482,7 @@ uint8_t *base64_dec(char *input, int *outlen) { BIO_write(bmem, input, inlen); while (inlen++ & 3) BIO_write(bmem, "=", 1); - BIO_flush(bmem); + (void) BIO_flush(bmem); int bufsize = strlen(input) * 3 / 4 + 1; uint8_t *buf = malloc(bufsize); diff --git a/shairport.c b/shairport.c index 2bea884f..7cb2c39a 100644 --- a/shairport.c +++ b/shairport.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #include #include "config.h" diff --git a/tinysvcmdns.c b/tinysvcmdns.c index bdce032c..d0cbebb8 100644 --- a/tinysvcmdns.c +++ b/tinysvcmdns.c @@ -416,7 +416,7 @@ int rr_list_append(struct rr_list **rr_head, struct rr_entry *rr) { if (*rr_head == NULL) { *rr_head = node; } else { - struct rr_list *e = *rr_head, *taile; + struct rr_list *e = *rr_head, *taile = NULL; for (; e; e = e->next) { // already in list - don't add if (e->e == rr) { @@ -426,7 +426,10 @@ int rr_list_append(struct rr_list **rr_head, struct rr_entry *rr) { if (e->next == NULL) taile = e; } - taile->next = node; + if (taile) + taile->next = node; + else + DEBUG_PRINTF("taile not given a value.\n"); } } else { die("can not allocate memory for \"node\" in tinysvcmdns."); @@ -500,7 +503,7 @@ struct rr_entry *rr_create(uint8_t *name, enum rr_type type) { } void rr_set_nsec(struct rr_entry *rr_nsec, enum rr_type type) { - assert(rr_nsec->type = RR_NSEC); + assert((rr_nsec->type = RR_NSEC)); assert((type / 8) < sizeof(rr_nsec->data.NSEC.bitmap)); rr_nsec->data.NSEC.bitmap[type / 8] = 1 << (7 - (type % 8));