summaryrefslogtreecommitdiff
path: root/log
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2017-11-07 12:22:09 -0800
committerFelix Fietkau <nbd@nbd.name>2017-11-13 09:39:11 +0100
commite7a63fbafdc6ec319bab616b43a642728f6b9c1c (patch)
tree58671ae64bc55ea51fac6d0a4790a29804064aea /log
parent2c0d9cfe05e9712d44622c6bb4558e97359bfb76 (diff)
downloadubox-e7a63fbafdc6ec319bab616b43a642728f6b9c1c.tar.gz
ubox: Remove unnecessary memset calls.
Change to calloc instead. Less verbose. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'log')
-rw-r--r--log/syslog.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/log/syslog.c b/log/syslog.c
index af6530c..0e1f2a9 100644
--- a/log/syslog.c
+++ b/log/syslog.c
@@ -246,15 +246,13 @@ log_list(int count, struct log_head *h)
int
log_buffer_init(int size)
{
- struct log_head *_log = malloc(size);
+ struct log_head *_log = calloc(1, size);
if (!_log) {
fprintf(stderr, "Failed to initialize log buffer with size %d\n", log_size);
return -1;
}
- memset(_log, 0, size);
-
if (log && ((log_size + sizeof(struct log_head)) < size)) {
struct log_head *start = _log;
struct log_head *end = ((void*) _log) + size;