summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@intec.ugent.be>2016-02-26 14:57:24 +0100
committerDimitri Staessens <dimitri.staessens@intec.ugent.be>2016-02-26 14:57:24 +0100
commitbb1d3fd141c33a98137edd9261a9adb9ea1d3753 (patch)
tree7c6e7c7513f4dddcf3f3e4c563b3ebf23a7265ab /src
parent44fa4a0d43a4026a091f82a055c649aa7c922706 (diff)
downloadouroboros-bb1d3fd141c33a98137edd9261a9adb9ea1d3753.tar.gz
ouroboros-bb1d3fd141c33a98137edd9261a9adb9ea1d3753.zip
doc: updated workflow and corrected all mallocs
lib/du_buff contained casted malloc's.
Diffstat (limited to 'src')
-rw-r--r--src/lib/du_buff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/du_buff.c b/src/lib/du_buff.c
index 324dccc5..ea6206f9 100644
--- a/src/lib/du_buff.c
+++ b/src/lib/du_buff.c
@@ -84,7 +84,7 @@ struct buffer * buffer_create (size_t size, size_t headspace, size_t len)
size_t ts = size - (headspace + len);
bool head_block = true;
- head = (struct buffer *) malloc(sizeof(struct buffer));
+ head = malloc(sizeof *head);
head->size=0;
head->data=NULL;
@@ -108,14 +108,14 @@ struct buffer * buffer_create (size_t size, size_t headspace, size_t len)
sz = remaining < page_size ? remaining : page_size;
}
- buf = (struct buffer *) malloc(sizeof(struct buffer));
+ buf = malloc(sizeof *buf);
if (buf == NULL) {
LOG_WARN("Could not allocate struct.");
return NULL;
}
if (sz > 0) {
- buf->data = (uint8_t *) malloc(sz);
+ buf->data = malloc(sz);
if (buf->data == NULL) {
LOG_WARN("Could not allocate memory block.");
buffer_destroy_list(head);