summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-02-27 12:26:35 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-02-27 12:26:35 +0100
commite5bfc52e93654a8be7893cf5573c9c04e9c96c55 (patch)
treeec6f93a22f1724f8ddf0d082faaaef3f01e65d75 /src/lib
parent4bfc45d1bc97b3df8212e3fcf7f10cbb660a8259 (diff)
parent223813bbd609d929537b9f3f54bf4eec99d7663b (diff)
downloadouroboros-e5bfc52e93654a8be7893cf5573c9c04e9c96c55.tar.gz
ouroboros-e5bfc52e93654a8be7893cf5573c9c04e9c96c55.zip
Merged in dstaesse/ouroboros/be-update-workflow (pull request #11)
workflow: Update guidelines on use of pointers
Diffstat (limited to 'src/lib')
-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 f365ffc2..bfb33339 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);