[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#657081: audacious: FTBFS on hurd-i386



Package: audacious
Version: 2.4.4-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd

Hello,

The attached small patch solves the build problem [1] of audacious for
GNU/Hurd. Instead of using PATH_MAX dynamic allocation of buffers are
made. The patched packages has been built on Linux and Hurd and run
tested on Linux (with valgrind there are heap and memory leaks, but they
don't seem to be due to the patch). 
[1]
https://buildd.debian.org/status/fetch.php?pkg=audacious&arch=hurd-i386&ver=2.4.4-1&stamp=1301922080

Thanks!
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;
+    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]);
+    file = fopen (path, mode);
+    g_free (path);
+    return file;
 }
 
 static void input_plugin_save (PluginHandle * plugin, FILE * handle)

Reply to: