]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blobdiff - src/sem.c
src/sem.c,src/tlsproxy.c: Minor cleanup.
[tlsproxy/tlsproxy.git] / src / sem.c
index 86fe39882c54a315e04a2f0b773f0b08db4aa801..563cea6d592f9361566c6c73e3578bf35b09d41f 100644 (file)
--- a/src/sem.c
+++ b/src/sem.c
@@ -1,7 +1,7 @@
 /*
  * Simple semaphore implementation, P() and V().
  *
- * Copyright (C) 2011  Simon Ruderich
+ * Copyright (C) 2011-2012  Simon Ruderich
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "sem.h"
+
 #include <stdlib.h>
 #include <pthread.h>
 
-#include "sem.h"
-
 
 struct SEM {
     pthread_mutex_t mutex;
@@ -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;
     }