changeset 18858:ac17673b640d

gets ride of a few more sizeof(char)s
author reynaldo
date Fri, 30 Jun 2006 04:24:07 +0000
parents 0ba653cbc29f
children 847b19fd59fa
files input/input.c libaf/af_export.c libmenu/menu_console.c loader/ldt_keeper.c
diffstat 4 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Fri Jun 30 04:09:29 2006 +0000
+++ b/input/input.c	Fri Jun 30 04:24:07 2006 +0000
@@ -690,7 +690,7 @@
 	ptr2 = e + 1;
         l--;
       }
-      cmd->args[i].v.s = (char*)malloc((l+1)*sizeof(char));
+      cmd->args[i].v.s = (char*)malloc(l+1);
       strncpy(cmd->args[i].v.s,start,l);
       cmd->args[i].v.s[l] = '\0';
       if(term != ' ') ptr += l+2;
@@ -746,7 +746,7 @@
 
   // Allocate the buffer if it doesn't exist
   if(!mp_fd->buffer) {
-    mp_fd->buffer = (char*)malloc(MP_CMD_MAX_SIZE*sizeof(char));
+    mp_fd->buffer = (char*)malloc(MP_CMD_MAX_SIZE);
     mp_fd->pos = 0;
     mp_fd->size = MP_CMD_MAX_SIZE;
   } 
@@ -802,7 +802,7 @@
 
     // Not dropping : put the cmd in ret
     if( ! (mp_fd->flags & MP_FD_DROP)) {
-      (*ret) = (char*)malloc((l+1)*sizeof(char));
+      (*ret) = (char*)malloc(l+1);
       strncpy((*ret),mp_fd->buffer,l);
       (*ret)[l] = '\0';
     } else { // Remove the dropping flag
--- a/libaf/af_export.c	Fri Jun 30 04:09:29 2006 +0000
+++ b/libaf/af_export.c	Fri Jun 30 04:24:07 2006 +0000
@@ -135,7 +135,7 @@
     if(s->filename)
       free(s->filename);
 
-    s->filename = calloc(i + 1, sizeof(char));
+    s->filename = calloc(i + 1, 1);
     memcpy(s->filename, str, i);
     s->filename[i] = 0;
 	
--- a/libmenu/menu_console.c	Fri Jun 30 04:09:29 2006 +0000
+++ b/libmenu/menu_console.c	Fri Jun 30 04:24:07 2006 +0000
@@ -467,7 +467,7 @@
   mpriv->lines = calloc(mpriv->buf_lines,sizeof(char*));
   mpriv->prompt = mpriv->mp_prompt;
   mpriv->cur_history = mpriv->history = calloc(1,sizeof(history_t));
-  mpriv->cur_history->buffer = calloc(255,sizeof(char));
+  mpriv->cur_history->buffer = calloc(255,1);
   mpriv->cur_history->size = 255;
   
   if(args)
--- a/loader/ldt_keeper.c	Fri Jun 30 04:09:29 2006 +0000
+++ b/loader/ldt_keeper.c	Fri Jun 30 04:24:07 2006 +0000
@@ -272,7 +272,7 @@
 
     Setup_FS_Segment();
 
-    ldt_fs->prev_struct = (char*)malloc(sizeof(char) * 8);
+    ldt_fs->prev_struct = (char*)malloc(8);
     *(void**)array.base_addr = ldt_fs->prev_struct;
 
     return ldt_fs;