changeset 438:04cb2d6e4f93 src tip

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 <fk AT fabiankeil DOT de>
author rathann
date Wed, 04 Dec 2013 23:02:01 +0000
parents d8ec83537d07
children
files vm/vm.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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) {