style. we use calloc
This commit is contained in:
1 parent
d906f23a0a
commit
482a6464a2
6 files changed
+7
-7
No files matched your search
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
RingBuffer *RingBuf_create(int capacity) {
|
||||
RingBuffer *buffer = (RingBuffer *)malloc(sizeof(RingBuffer));
|
||||
RingBuffer *buffer = (RingBuffer *)calloc(sizeof(RingBuffer), sizeof(uint8_t));
|
||||
if (!buffer) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user