On Mon, 2012-01-23 at 23:31 +0100, Pino Toscano wrote: > Alle lunedì 23 gennaio 2012, Svante Signell ha scritto: > > + 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]); > > path = g_strdup_printf ("%s/" FILENAME, aud_paths[BMP_PATH_USER_DIR]); > (with no need for 'len')
OK, updated patch attached! Much shorter now :)
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-24 00:20:27.000000000 +0100 @@ -156,9 +156,13 @@ 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; + + path = g_strdup_printf ("%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)
_______________________________________________ pkg-multimedia-maintainers mailing list pkg-multimedia-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers