fix calloc() calls

* size_t nmemb (number of elements) first, then size_t size
* do not assume char is size 1 but use sizeof()
* allocate for char, not pointer to char (found by Michael McConville,
  fixes #261)
This commit is contained in:
Christian Hesse
2015-09-07 07:52:39 +02:00
parent 2df36ee2f2
commit e8970b6f32
6 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ ProcessClass DarwinProcess_class = {
};
DarwinProcess* DarwinProcess_new(Settings* settings) {
DarwinProcess* this = calloc(sizeof(DarwinProcess), 1);
DarwinProcess* this = calloc(1, sizeof(DarwinProcess));
Object_setClass(this, Class(DarwinProcess));
Process_init(&this->super, settings);