mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
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:
@ -86,7 +86,7 @@ ProcessPidColumn Process_pidColumns[] = {
|
||||
};
|
||||
|
||||
FreeBSDProcess* FreeBSDProcess_new(Settings* settings) {
|
||||
FreeBSDProcess* this = calloc(sizeof(FreeBSDProcess), 1);
|
||||
FreeBSDProcess* this = calloc(1, sizeof(FreeBSDProcess));
|
||||
Object_setClass(this, Class(FreeBSDProcess));
|
||||
Process_init(&this->super, settings);
|
||||
return this;
|
||||
|
Reference in New Issue
Block a user