Mercurial > mplayer.hg
changeset 18857:0ba653cbc29f
more sizeof(char) fun
author | reynaldo |
---|---|
date | Fri, 30 Jun 2006 04:09:29 +0000 |
parents | 8f3099900d8c |
children | ac17673b640d |
files | mplayer.c subreader.c |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mplayer.c Fri Jun 30 03:18:12 2006 +0000 +++ b/mplayer.c Fri Jun 30 04:09:29 2006 +0000 @@ -2993,7 +2993,7 @@ mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,vobsub_name); }else if(sub_auto && filename && (strlen(filename)>=5)){ /* try to autodetect vobsub from movie filename ::atmos */ - char *buf = malloc((strlen(filename)-3) * sizeof(char)),*psub; + char *buf = malloc((strlen(filename)-3)),*psub; memset(buf,0,strlen(filename)-3); // make sure string is terminated strncpy(buf, filename, strlen(filename)-4); vo_vobsub=vobsub_open(buf,spudec_ifo,0,&vo_spudec); @@ -3152,7 +3152,7 @@ if (filename && !strcmp(mp_basename(playlist_entry),playlist_entry)) // add reference path of current file { - temp=malloc((strlen(filename)-strlen(mp_basename(filename))+strlen(playlist_entry)+1)*sizeof(char)); + temp=malloc((strlen(filename)-strlen(mp_basename(filename))+strlen(playlist_entry)+1)); if (temp) { strncpy(temp, filename, strlen(filename)-strlen(mp_basename(filename)));
--- a/subreader.c Fri Jun 30 03:18:12 2006 +0000 +++ b/subreader.c Fri Jun 30 04:09:29 2006 +0000 @@ -1218,7 +1218,7 @@ if(log2vis) { len = fribidi_remove_bidi_marks (visual, len, NULL, NULL, NULL); - if((op = (char*)malloc(sizeof(char)*(max(2*orig_len,2*len) + 1))) == NULL) { + if((op = (char*)malloc((max(2*orig_len,2*len) + 1))) == NULL) { mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error allocating mem.\n"); l++; break; @@ -1314,7 +1314,7 @@ char *detected_sub_cp = NULL; int i; - buffer = (unsigned char*)malloc(MAX_GUESS_BUFFER_SIZE*sizeof(char)); + buffer = (unsigned char*)malloc(MAX_GUESS_BUFFER_SIZE); buflen = stream_read(st,buffer, MAX_GUESS_BUFFER_SIZE); languages = enca_get_languages(&langcnt);