mirror of https://github.com/mpv-player/mpv
gets ride of a few more sizeof(char)s
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18862 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4f593b3393
commit
c71983202c
|
@ -690,7 +690,7 @@ mp_input_parse_cmd(char* str) {
|
||||||
ptr2 = e + 1;
|
ptr2 = e + 1;
|
||||||
l--;
|
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);
|
strncpy(cmd->args[i].v.s,start,l);
|
||||||
cmd->args[i].v.s[l] = '\0';
|
cmd->args[i].v.s[l] = '\0';
|
||||||
if(term != ' ') ptr += l+2;
|
if(term != ' ') ptr += l+2;
|
||||||
|
@ -746,7 +746,7 @@ mp_input_read_cmd(mp_input_fd_t* mp_fd, char** ret) {
|
||||||
|
|
||||||
// Allocate the buffer if it doesn't exist
|
// Allocate the buffer if it doesn't exist
|
||||||
if(!mp_fd->buffer) {
|
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->pos = 0;
|
||||||
mp_fd->size = MP_CMD_MAX_SIZE;
|
mp_fd->size = MP_CMD_MAX_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -802,7 +802,7 @@ mp_input_read_cmd(mp_input_fd_t* mp_fd, char** ret) {
|
||||||
|
|
||||||
// Not dropping : put the cmd in ret
|
// Not dropping : put the cmd in ret
|
||||||
if( ! (mp_fd->flags & MP_FD_DROP)) {
|
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);
|
strncpy((*ret),mp_fd->buffer,l);
|
||||||
(*ret)[l] = '\0';
|
(*ret)[l] = '\0';
|
||||||
} else { // Remove the dropping flag
|
} else { // Remove the dropping flag
|
||||||
|
|
|
@ -135,7 +135,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||||
if(s->filename)
|
if(s->filename)
|
||||||
free(s->filename);
|
free(s->filename);
|
||||||
|
|
||||||
s->filename = calloc(i + 1, sizeof(char));
|
s->filename = calloc(i + 1, 1);
|
||||||
memcpy(s->filename, str, i);
|
memcpy(s->filename, str, i);
|
||||||
s->filename[i] = 0;
|
s->filename[i] = 0;
|
||||||
|
|
||||||
|
|
|
@ -467,7 +467,7 @@ static int openMenu(menu_t* menu, char* args) {
|
||||||
mpriv->lines = calloc(mpriv->buf_lines,sizeof(char*));
|
mpriv->lines = calloc(mpriv->buf_lines,sizeof(char*));
|
||||||
mpriv->prompt = mpriv->mp_prompt;
|
mpriv->prompt = mpriv->mp_prompt;
|
||||||
mpriv->cur_history = mpriv->history = calloc(1,sizeof(history_t));
|
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;
|
mpriv->cur_history->size = 255;
|
||||||
|
|
||||||
if(args)
|
if(args)
|
||||||
|
|
|
@ -272,7 +272,7 @@ ldt_fs_t* Setup_LDT_Keeper(void)
|
||||||
|
|
||||||
Setup_FS_Segment();
|
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;
|
*(void**)array.base_addr = ldt_fs->prev_struct;
|
||||||
|
|
||||||
return ldt_fs;
|
return ldt_fs;
|
||||||
|
|
Loading…
Reference in New Issue