# HG changeset patch # User rathann # Date 1386198121 0 # Node ID 04cb2d6e4f93bea6cc6eda83195b7700983a12de # Parent d8ec83537d07e146ebaee52d108fca919f37d7aa In vm_new_vm(), use the proper calloc() argument order .. and don't derive 1 from the unrelated sizeof(char). Fixes the scan-anaylzer "API violation" warning: Result of 'calloc' is converted to a pointer of type 'vm_t', which is incompatible with sizeof operand type 'char' Patch by Fabian Keil diff -r d8ec83537d07 -r 04cb2d6e4f93 vm/vm.c --- a/vm/vm.c Tue Nov 12 00:55:10 2013 +0000 +++ b/vm/vm.c Wed Dec 04 23:02:01 2013 +0000 @@ -263,7 +263,7 @@ /* Initialisation & Destruction */ vm_t* vm_new_vm() { - return (vm_t*)calloc(sizeof(vm_t), sizeof(char)); + return (vm_t*)calloc(1, sizeof(vm_t)); } void vm_free_vm(vm_t *vm) {