From: Simon Ruderich Date: Sun, 11 Mar 2012 21:50:59 +0000 (+0100) Subject: src/sem.c,src/tlsproxy.c: Minor cleanup. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=0f69065a13b6831dadd2aef7928ee9654b7f43d1;p=tlsproxy%2Ftlsproxy.git src/sem.c,src/tlsproxy.c: Minor cleanup. --- diff --git a/src/sem.c b/src/sem.c index 86f1a15..563cea6 100644 --- a/src/sem.c +++ b/src/sem.c @@ -30,7 +30,7 @@ struct SEM { }; SEM *sem_init(int init_value) { - SEM *sem = (SEM *)malloc(sizeof(SEM)); + SEM *sem = malloc(sizeof(*sem)); if (NULL == sem) { return NULL; } diff --git a/src/tlsproxy.c b/src/tlsproxy.c index ad257b5..6ce976c 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -137,7 +137,7 @@ int main(int argc, char **argv) { initialize_gnutls(); /* Spawn worker threads to handle requests. */ - threads = (pthread_t *)malloc(thread_count * sizeof(pthread_t)); + threads = malloc(thread_count * sizeof(*threads)); if (NULL == threads) { perror("thread malloc failed"); return EXIT_FAILURE; @@ -234,7 +234,6 @@ int main(int argc, char **argv) { errno = pthread_join(threads[i], NULL); if (0 != errno) { perror("pthread_join()"); - continue; } }