cosmetic patch to remove useless sizeof(char) statements

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18858 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ben 2006-06-29 21:53:35 +00:00
parent 46dc121052
commit 6ab349aa68
1 changed files with 7 additions and 7 deletions

View File

@ -201,7 +201,7 @@ static char *rtsp_get(rtsp_t *s) {
mp_msg(MSGT_OPEN, MSGL_FATAL, "librtsp: buffer overflow in rtsp_get\n"); mp_msg(MSGT_OPEN, MSGL_FATAL, "librtsp: buffer overflow in rtsp_get\n");
exit(1); exit(1);
} }
string=malloc(sizeof(char)*n); string=malloc(n);
memcpy(string,buffer,n-1); memcpy(string,buffer,n-1);
string[n-1]=0; string[n-1]=0;
@ -221,7 +221,7 @@ static char *rtsp_get(rtsp_t *s) {
static void rtsp_put(rtsp_t *s, const char *string) { static void rtsp_put(rtsp_t *s, const char *string) {
int len=strlen(string); int len=strlen(string);
char *buf=malloc(sizeof(char)*len+2); char *buf=malloc(len+2);
#ifdef LOG #ifdef LOG
mp_msg(MSGT_OPEN, MSGL_INFO, "librtsp: >> '%s'", string); mp_msg(MSGT_OPEN, MSGL_INFO, "librtsp: >> '%s'", string);
@ -405,7 +405,7 @@ int rtsp_request_options(rtsp_t *s, const char *what) {
buf=strdup(what); buf=strdup(what);
} else } else
{ {
buf=malloc(sizeof(char)*(strlen(s->host)+16)); buf=malloc(strlen(s->host)+16);
sprintf(buf,"rtsp://%s:%i", s->host, s->port); sprintf(buf,"rtsp://%s:%i", s->host, s->port);
} }
rtsp_send_request(s,RTSP_METHOD_OPTIONS,buf); rtsp_send_request(s,RTSP_METHOD_OPTIONS,buf);
@ -422,7 +422,7 @@ int rtsp_request_describe(rtsp_t *s, const char *what) {
buf=strdup(what); buf=strdup(what);
} else } else
{ {
buf=malloc(sizeof(char)*(strlen(s->host)+strlen(s->path)+16)); buf=malloc(strlen(s->host)+strlen(s->path)+16);
sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path); sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
} }
rtsp_send_request(s,RTSP_METHOD_DESCRIBE,buf); rtsp_send_request(s,RTSP_METHOD_DESCRIBE,buf);
@ -461,7 +461,7 @@ int rtsp_request_setparameter(rtsp_t *s, const char *what) {
buf=strdup(what); buf=strdup(what);
} else } else
{ {
buf=malloc(sizeof(char)*(strlen(s->host)+strlen(s->path)+16)); buf=malloc(strlen(s->host)+strlen(s->path)+16);
sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path); sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
} }
rtsp_send_request(s,RTSP_METHOD_SET_PARAMETER,buf); rtsp_send_request(s,RTSP_METHOD_SET_PARAMETER,buf);
@ -479,7 +479,7 @@ int rtsp_request_play(rtsp_t *s, const char *what) {
buf=strdup(what); buf=strdup(what);
} else } else
{ {
buf=malloc(sizeof(char)*(strlen(s->host)+strlen(s->path)+16)); buf=malloc(strlen(s->host)+strlen(s->path)+16);
sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path); sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
} }
rtsp_send_request(s,RTSP_METHOD_PLAY,buf); rtsp_send_request(s,RTSP_METHOD_PLAY,buf);
@ -548,7 +548,7 @@ int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size) {
} }
/* let's make the server happy */ /* let's make the server happy */
rtsp_put(s, "RTSP/1.0 451 Parameter Not Understood"); rtsp_put(s, "RTSP/1.0 451 Parameter Not Understood");
rest=malloc(sizeof(char)*17); rest=malloc(17);
sprintf(rest,"CSeq: %u", seq); sprintf(rest,"CSeq: %u", seq);
rtsp_put(s, rest); rtsp_put(s, rest);
rtsp_put(s, ""); rtsp_put(s, "");