[MPlayer-dev-eng] [PATCH 6/7] stream ftp: Allocate command buffer on-heap

Diego Biurrun diego at biurrun.de
Wed Nov 14 12:08:41 CET 2012


On Sun, Nov 11, 2012 at 10:01:41PM +0100, Alexander Strasser wrote:
> --- a/stream/stream_ftp.c
> +++ b/stream/stream_ftp.c
> @@ -51,6 +51,7 @@ static struct stream_priv_s {
>    int handle;
>    int cavail,cleft;
>    char *buf;
> +  char *cmd_buf;
>  } stream_priv_dflts = {
>    "anonymous","no at spam",
>    NULL,
> @@ -61,9 +62,12 @@ static struct stream_priv_s {
>  
>    0,
>    0,0,
> -  NULL
> +  NULL,
> +  NULL,
>  };

The object you are initializing is static, so every member is implicitly
initialized to NULL or 0 anyway.  You should rather drop the pointless
0/NULL initializations and replace the others by designated initializers
if you want to clean this up.

Diego


More information about the MPlayer-dev-eng mailing list