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

Hello,

The attached small patch solves the build problems of audacious-plugins
for GNU/Hurd (after installation of audacious, see  #657081). Dynamic
allocation of buffers is made with the aid of g_strdup_printf() in one
of the remaining plugins still using PATH_MAX, scrobbler.c

Thanks!
diff -ur audacious-plugins-2.4.4/src/scrobbler/scrobbler.c audacious-plugins-2.4.4.modified/src/scrobbler/scrobbler.c
--- audacious-plugins-2.4.4/src/scrobbler/scrobbler.c	2011-02-22 18:29:46.000000000 +0100
+++ audacious-plugins-2.4.4.modified/src/scrobbler/scrobbler.c	2012-01-24 00:32:41.000000000 +0100
@@ -917,17 +917,19 @@
 static void read_cache(void)
 {
     FILE *fd;
-    char buf[PATH_MAX];
+    char *buf = NULL;
     int i=0;
     item_t *item;
     gchar* config_datadir;
 
     config_datadir = aud_util_get_localdir();
-    g_snprintf(buf, sizeof(buf), "%s/scrobblerqueue.txt", config_datadir);
+    buf = g_strdup_printf("%s/scrobblerqueue.txt", config_datadir);
     g_free(config_datadir);
 
-    if (!(fd = fopen(buf, "r")))
+    if (!(fd = fopen(buf, "r"))) {
+        g_free(buf);
         return;
+    }
     AUDDBG("Opening %s\n", buf);
     fclose(fd);
 
@@ -936,6 +938,7 @@
     gchar** entry;
     g_file_get_contents(buf, &cache, NULL, NULL);
     values = g_strsplit(cache, "\n", 0);
+    g_free(buf);
 
     int x;
     for (x=0; values[x] && strlen(values[x]); x++) {
@@ -994,7 +997,7 @@
 {
     FILE *fd;
     item_t *item;
-    char *home, buf[PATH_MAX];
+    char *home, *buf = NULL;
     gchar* config_datadir;
 
     /*AUDDBG("Entering dump_queue();");*/
@@ -1006,17 +1009,19 @@
     }
 
     config_datadir = aud_util_get_localdir();
-    g_snprintf(buf, sizeof(buf), "%s/scrobblerqueue.txt", config_datadir);
+    buf = g_strdup_printf("%s/scrobblerqueue.txt", config_datadir);
     g_free(config_datadir);
 
     if (!(fd = fopen(buf, "w")))
     {
         AUDDBG("Failure opening %s\n", buf);
+        g_free(buf);
         return;
     }
 
     AUDDBG("Opening %s\n", buf);
 
+    g_free(buf);
     q_peekall(1);
 
     /*
_______________________________________________
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