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

Re: abiword: FTBFS on hurd-i386



Hi!

On Wed, 2011-11-09 at 18:15:50 +0100, Svante Signell wrote:
> diff -ur abiword-2.9.1/src/af/xap/gtk/xap_UnixApp.cpp abiword-2.9.1.modified/src/af/xap/gtk/xap_UnixApp.cpp
> --- abiword-2.9.1/src/af/xap/gtk/xap_UnixApp.cpp	2011-05-09 09:32:28.000000000 +0200
> +++ abiword-2.9.1.modified/src/af/xap/gtk/xap_UnixApp.cpp	2011-11-09 15:58:06.000000000 +0100
> @@ -271,12 +271,13 @@
>  {
>  	// FIXME: this code sucks hard
>  
> -	char buf[PATH_MAX];
> +	char * buf = NULL;
>  	
>  	// see if ABIWORD_DATADIR was set in the environment
>  	const char * sz = getenv("ABIWORD_DATADIR");
>  	if (sz && *sz)
>  	{
> +		buf = (gchar *)g_malloc(strlen(sz)+1);
>  		strcpy(buf,sz);
>  		char * p = buf;
>  		int len = strlen(p);

You could either use g_strdup() or rearrange the code to reuse len
instead of doing strlen(sz) twice.

regards,
guillem


Reply to: