Re: Trash after build string



On Sunday, May 27, 2001, at 08:23  PM, Magnus Wirström wrote:

When I use g_strconcat I get trash after the actual string.

This line is wrong.

	test = g_strconcat(tar,"-x);

It should be:

	test = g_strconcat(tar,"-x",NULL);

Also, your example leaks storage. You should do:

	g_free(tarfile);
	g_free(tar);
	g_free(test);

at the end of the function.

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]