Hi!

On Mon, 2012-01-23 at 22:56:27 +0100, Svante Signell wrote:
> Package: audacious
> Version: 2.4.4-1
> Severity: important
> Tags: patch
> User: debian-h...@lists.debian.org
> Usertags: hurd

> diff -ur audacious-2.4.4/src/audacious/plugin-registry.c 
> audacious-2.4.4.modified/src/audacious/plugin-registry.c
> --- audacious-2.4.4/src/audacious/plugin-registry.c   2011-02-22 
> 18:29:02.000000000 +0100
> +++ audacious-2.4.4.modified/src/audacious/plugin-registry.c  2012-01-23 
> 22:08:59.000000000 +0100
> @@ -156,9 +156,16 @@
>  
>  static FILE * open_registry_file (const gchar * mode)
>  {
> -    gchar path[PATH_MAX];
> -    snprintf (path, sizeof path, "%s/" FILENAME, 
> aud_paths[BMP_PATH_USER_DIR]);
> -    return fopen (path, mode);
> +    FILE *file;
> +    gchar *path = NULL;

There's no need to initialize path here, as it gets always assigned to
later on.

> +    int len;
> +
> +    len = strlen(FILENAME) + 1 + strlen(aud_paths[BMP_PATH_USER_DIR]) + 1;
> +    path = g_malloc (len);
> +    snprintf (path, len, "%s/" FILENAME, aud_paths[BMP_PATH_USER_DIR]);

Instead of this you can use the more compact and less error prone
g_strdup_printf() or g_strconcat().

> +    file = fopen (path, mode);
> +    g_free (path);
> +    return file;
>  }

thanks,
guillem



_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to