Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/libpainter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2017-01-22 10:56:19 +0300
committermetalefty <meta@vmeta.jp>2017-02-07 07:58:24 +0300
commit59d4ecfd9e3601b66e358b9ef74491c315832132 (patch)
treeb37f308fea6085f881c1b83e0a600c229b870d0a
parent771cd9621c9c156b4993644253577e56f1b589a0 (diff)
Use calloc() to allocate zeroed memory
-rw-r--r--src/painter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/painter.c b/src/painter.c
index e76202f..160ba04 100644
--- a/src/painter.c
+++ b/src/painter.c
@@ -33,12 +33,12 @@ painter_create(void **handle)
{
return PT_ERROR_PARAM;
}
- *handle = malloc(sizeof(struct painter));
+
+ *handle = calloc(1, sizeof(struct painter));
if (*handle == NULL)
{
return PT_ERROR_OUT_OF_MEM;
}
- memset(*handle, 0, sizeof(struct painter));
pt = (struct painter *) *handle;
pt->rop = PT_ROP_S;