[MPlayer-dev-eng] [PATCH] Add support for directory-wide configuration overrides V4.0 [correction]

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Aug 31 17:16:02 CEST 2009


On Mon, Aug 31, 2009 at 06:02:05PM +0300, Christian P. Schmidt wrote:
> @@ -931,13 +932,11 @@
>  {
>      char *confpath;
>      char cfg[strlen(file)+10];
> +    char dircfg[strlen(file)+14];

Can be moved inside the use_filedir_conf block.

> @@ -952,6 +951,15 @@
>      else
>  	name++;
>  
> +    if (use_filedir_conf) {
> +        av_strlcpy(dircfg, cfg, name-cfg+1);
> +        strcat(dircfg, "mplayer.conf");

Even if you don't like my approach with a backup variable, I'd consider
strcpy(dircfg, cfg);
strcpy(dircfg + (name - cfg), "mplayer.conf");
clearer.
That is apart from further (unrelated to this patch) changes in the code that would be a good
idea, e.g. making the variable of size MAX_PATH (if strlen(file) is
several MB the current code will not handle it well and not strn/strl
function will help).



More information about the MPlayer-dev-eng mailing list