Bug#657081: audacious: FTBFS on hurd-i386
Guillem Jover
guillem at debian.org
Tue Jan 24 00:03:36 UTC 2012
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-hurd at 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
More information about the pkg-multimedia-maintainers
mailing list