Bladeren bron

Fix the manditory typo in my last minute untested fix.
-Erik

Eric Andersen 20 jaren geleden
bovenliggende
commit
6373c2b141
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      libc/stdlib/malloc-standard/calloc.c

+ 1 - 1
libc/stdlib/malloc-standard/calloc.c

@@ -29,7 +29,7 @@ void* calloc(size_t n_elements, size_t elem_size)
 
     /* guard vs integer overflow, but allow nmemb
      * to fall through and call malloc(0) */
-    size=lsize * nmemb;
+    size = n_elements * elem_size;
     if (n_elements && elem_size != (size / n_elements)) {
 	__set_errno(ENOMEM);
 	return NULL;