On Mon, Mar 10, 2003 at 08:37:09PM +0200, Daniel Daboul wrote:
I hacked a fix for function "a_Bookmarks_add" in src/bookmark.c that avoids the seg-fault and allow me to use bookmarks. Since I use malloc, sprintf and free instead of g_strdup_printf and g_free I don't submit it as patch, but I hope it'll help to find the clean fix. I attached the fixed "a_Bookmarks_add" at the bottom. -- Daniel
well, your solution is the old version of that function :-) a fix I sent to Jorge earlier would be (it might even get acceptexd ;-) ...) : --- src/bookmark.c.orig Mon Mar 10 19:13:26 2003 +++ src/bookmark.c Mon Mar 10 18:47:22 2003 @@ -80,7 +80,7 @@ BrowserWindow *bw = (BrowserWindow *)client_data; gchar *title; DilloUrl *url; - char *cmd = NULL; + gchar *cmd = NULL; url = a_Menu_popup_get_url(bw); g_return_if_fail(url != NULL); @@ -88,7 +88,7 @@ /* if the page has no title, we'll use the url string */ title = (gchar *) a_History_get_title_by_url(url, 1); - g_strdup_printf(cmd, "<dpi cmd='add_bookmark' url='%s' title='%s'>", + cmd = g_strdup_printf("<dpi cmd='add_bookmark' url='%s' title='%s'>", URL_STR(url), title); a_Bookmarks_chat_add(bw, cmd, NULL); g_free(cmd); Cheers Andreas -- **************************** NEW ADDRESS ****************************** Hamburger Sternwarte Universitaet Hamburg Gojenbergsweg 112 Tel. ++49 40 42891 4016 D-21029 Hamburg, Germany Fax. ++49 40 42891 4198