[Fwd: audacious-plugins: FTBFS on hurd-i386]
FYI: (Forgot the x-debbugs-cc header)
-------- Forwarded Message --------
From: Svante Signell <svante.signell@telia.com>
Reply-to: svante.signell@telia.com
To: Debian bug reporting <submit@bugs.debian.org>
Subject: audacious-plugins: FTBFS on hurd-i386
Date: Tue, 24 Jan 2012 00:39:51 +0100
Package: audacious-plugins
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 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);
/*
Reply to: