[gcompris-devel] [PATCH] Initialize the new GcomprisProperties with zeros

Bruno Coudoin bruno.coudoin at gcompris.net
Wed Jan 26 17:52:05 UTC 2011


Hi,

Thanks a lot for your investigation. I think the best is to initialize
the cursor property like it is done for the other values of the property
structure. I'll make a patch soon.

Bruno.

Le mercredi 26 janvier 2011 à 06:49 +0200, Peter Ujfalusi a écrit :
> gc_prop_new uses malloc to allocate the GcomprisProperties.
> Since malloc does not initialize the allocated memory, we
> need to make sure, that it is initialized correctly.
> Use memset to fill the allocated memory with zero.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at gmail.com>
> ---
> Hello,
> 
> this patch fixes the problem that I have on 64bit machine:
> No cursor visible after starting GCompris.
> I have traced it down, and the tmp->nocursor was TRUE right
> after the malloc call.
> 
> The patch is generated agains the git master.
> 
> PS: I'm not sure about the patch sending protocol for
> GCompris, but I suppose git send-email shall be fine...
> 
> Br,
> Peter
> 
>  src/gcompris/properties.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/gcompris/properties.c b/src/gcompris/properties.c
> index 29e43dd..0cd18cf 100644
> --- a/src/gcompris/properties.c
> +++ b/src/gcompris/properties.c
> @@ -144,6 +144,7 @@ gc_prop_new ()
>    GcomprisProperties *tmp;
>  
>    tmp = (GcomprisProperties *) malloc (sizeof (GcomprisProperties));
> +  memset (tmp, 0, sizeof (GcomprisProperties));
>    tmp->music		 = 1;
>    tmp->fx		 = 1;
>    tmp->fullscreen	 = 1;








More information about the Gcompris-devel mailing list