# HG changeset patch # User reynaldo # Date 1151641447 0 # Node ID ac17673b640d45366e52e8b978121537f4ca15ec # Parent 0ba653cbc29fb2638f6692908a3b6b69b7da551a gets ride of a few more sizeof(char)s diff -r 0ba653cbc29f -r ac17673b640d input/input.c --- 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 diff -r 0ba653cbc29f -r ac17673b640d libaf/af_export.c --- 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; diff -r 0ba653cbc29f -r ac17673b640d libmenu/menu_console.c --- 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) diff -r 0ba653cbc29f -r ac17673b640d loader/ldt_keeper.c --- 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;