Re: gtk+-1.1.6 report
- From: Tim Janik <timj gtk org>
- To: gtk-devel-list redhat com
- Subject: Re: gtk+-1.1.6 report
- Date: Wed, 9 Dec 1998 23:41:21 +0100 (CET)
On 9 Dec 1998, Owen Taylor wrote:
>
> I suspect the following patch which I added to CVS last
> night fixes that.
> Owen
>
> Index: gtkrc.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
> retrieving revision 1.29
> retrieving revision 1.30
> diff -u -r1.29 -r1.30
> --- gtkrc.c 1998/12/09 01:05:39 1.29
> +++ gtkrc.c 1998/12/09 05:43:35 1.30
> @@ -336,12 +336,12 @@
> }
> else
> {
> - str = g_malloc (strlen(GTK_SYSCONFDIR) + strlen("/gtkrc"));
> + str = g_malloc (strlen(GTK_SYSCONFDIR) + strlen("/gtkrc") + 1);
> sprintf (str, "%s%s", GTK_SYSCONFDIR, "/gtkrc");
> gtk_rc_add_default_file (str);
>
> var = g_get_home_dir ();
> - str = g_malloc (strlen(var) + strlen("/.gtkrc"));
> + str = g_malloc (strlen(var) + strlen("/.gtkrc") + 1);
people should really use g_strconcat for such cases,
it saves a lot of error prone code portions, and is actually
a lot more convenient.
> sprintf (str, "%s%s", var, "/.gtkrc");
> gtk_rc_add_default_file (str);
> }
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]