changeset 5691:a93fc56763fd

Scale by sizeof when allocating objects.
author Karl Heuer <kwzh@gnu.org>
date Sat, 29 Jan 1994 02:09:41 +0000
parents 3b4bb6d2c922
children bb9b20ea092d
files src/keymap.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Sat Jan 29 02:03:55 1994 +0000
+++ b/src/keymap.c	Sat Jan 29 02:09:41 1994 +0000
@@ -775,15 +775,21 @@
 	    if (cmm_maps)
 	      {
 		BLOCK_INPUT;
-		newmodes = (Lisp_Object *) realloc (cmm_modes, cmm_size *= 2);
-		newmaps  = (Lisp_Object *) realloc (cmm_maps,  cmm_size);
+		cmm_size *= 2;
+		newmodes = (Lisp_Object *)
+		  realloc (cmm_modes, cmm_size * sizeof (Lisp_Object));
+		newmaps  = (Lisp_Object *)
+		  realloc (cmm_maps,  cmm_size * sizeof (Lisp_Object));
 		UNBLOCK_INPUT;
 	      }
 	    else
 	      {
 		BLOCK_INPUT;
-		newmodes = (Lisp_Object *) malloc (cmm_size = 30);
-		newmaps  = (Lisp_Object *) malloc (cmm_size);
+		cmm_size = 30;
+		newmodes = (Lisp_Object *)
+		  malloc (cmm_size * sizeof (Lisp_Object));
+		newmaps  = (Lisp_Object *)
+		  malloc (cmm_size * sizeof (Lisp_Object));
 		UNBLOCK_INPUT;
 	      }