rem: etat = malloc ( sizeof ( struct struct_etat ));
add: etat = calloc ( 1, sizeof ( struct struct_etat ));
context: gboolean charge_etat_version_0_4_0 ( xmlDocPtr doc ){  xmlNodePtr node;  struct struct_etat *etat;		        etat = malloc ( sizeof ( struct struct_etat ));  /* on place node sur les generalites */  node = doc -> root -> childs;  while ( node )    {      if ( !strcmp ( node -> name,		     "Generalites" ) )	{	  xmlNodePtr node_generalites;	  /* node_generalites va faire le tour des generalites */	  node_generalites = node -> childs;	  while ( node_generalites )	    {	      if ( !strcmp ( node_generalites -> name,			     "Nom" ))		etat -> nom_etat = xmlNodeGetContent ( node_generalites );	      node_generalites = node_generalites -> next;	    }	}      /* on recupre ici l'etat */      if ( !strcmp ( node -> name,		     "Details" ))	{	  etat -> type_classement = NULL;	  if ( strlen ( xmlGetProp ( node,				     "Type_classement" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"Type_classement" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat -> type_classement = g_list_append ( etat -> type_classement,							    GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }	  etat -> afficher_r = atoi ( xmlGetProp ( node,						   "Aff_r" ));	  etat -> afficher_opes = atoi ( xmlGetProp ( node,						      "Aff_ope" ));	  etat -> afficher_no_ope = atoi ( xmlGetProp ( node,							"Aff_no_ope" ));	  etat -> afficher_date_ope = atoi ( xmlGetProp ( node,							  "Aff_date_ope" ));	  etat -> afficher_tiers_ope = atoi ( xmlGetProp ( node,							   "Aff_tiers_ope" ));	  etat -> afficher_categ_ope = atoi ( xmlGetProp ( node,							   "Aff_categ_ope" ));	  etat -> afficher_sous_categ_ope = atoi ( xmlGetProp ( node,								"Aff_ss_categ_ope" ));	  etat -> afficher_type_ope = atoi ( xmlGetProp ( node,							  "Aff_type_ope" ));	  etat -> afficher_ib_ope = atoi ( xmlGetProp ( node,							"Aff_ib_ope" ));	  etat -> afficher_sous_ib_ope = atoi ( xmlGetProp ( node,							     "Aff_ss_ib_ope" ));	  etat -> afficher_cheque_ope = atoi ( xmlGetProp ( node,							    "Aff_cheque_ope" ));	  etat -> afficher_notes_ope = atoi ( xmlGetProp ( node,							   "Aff_notes_ope" ));	  etat -> afficher_pc_ope = atoi ( xmlGetProp ( node,							"Aff_pc_ope" ));	  etat -> afficher_rappr_ope = atoi ( xmlGetProp ( node,							   "Aff_rappr_ope" ));	  etat -> afficher_infobd_ope = atoi ( xmlGetProp ( node,							    "Aff_infobd_ope" ));	  etat -> afficher_exo_ope = atoi ( xmlGetProp ( node,							 "Aff_exo_ope" ));	  etat -> afficher_titre_colonnes = atoi ( xmlGetProp ( node,								"Aff_titres_col" ));	  etat -> type_affichage_titres = atoi ( xmlGetProp ( node,							      "Aff_titres_chgt" ));	  etat -> pas_detailler_ventilation = atoi ( xmlGetProp ( node,								  "Pas_detail_ventil" ));	  etat -> devise_de_calcul_general = atoi ( xmlGetProp ( node,								 "Devise_gen" ));	  etat -> exo_date = atoi ( xmlGetProp ( node,						 "Exo_date" ));							  			  	  etat -> utilise_detail_exo = atoi ( xmlGetProp ( node,							   "Detail_exo" ));							  			  	  etat -> no_exercices = NULL;	  if ( strlen ( xmlGetProp ( node,				     "No_exo" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"No_exo" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat -> no_exercices = g_slist_append ( etat -> no_exercices,							  GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }										 	  etat -> no_plage_date = atoi ( xmlGetProp ( node,						      "Plage_date" ));	  if ( strlen ( xmlGetProp ( node,				     "Date_debut" )))	    {	      gchar **pointeur_char;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"Date_debut" ),					   "/",					   3 );	      etat -> date_perso_debut = g_date_new_dmy ( atoi ( pointeur_char[0] ),							  atoi ( pointeur_char[1] ),							  atoi ( pointeur_char[2] ));	      g_strfreev ( pointeur_char );	    }	  else	    etat -> date_perso_debut = NULL;	  if ( strlen ( xmlGetProp ( node,				     "Date_fin" )))	    {	      gchar **pointeur_char;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"Date_fin" ),					   "/",					   3 );	      etat -> date_perso_fin = g_date_new_dmy ( atoi ( pointeur_char[0] ),							atoi ( pointeur_char[1] ),							atoi ( pointeur_char[2] ));	      g_strfreev ( pointeur_char );	    }	  else	    etat -> date_perso_fin = NULL;	  etat -> separation_par_plage = atoi ( xmlGetProp ( node,							     "Utilise_plages" ));	  etat -> type_separation_plage = atoi ( xmlGetProp ( node,							      "Sep_plages" ));	  etat -> jour_debut_semaine = atoi ( xmlGetProp ( node,							   "Deb_sem_plages" ));	  etat -> type_separation_perso = atoi ( xmlGetProp ( node,							      "Sep_perso_plages" ));	  etat -> delai_separation_perso = atoi ( xmlGetProp ( node,							       "Delai_perso_plages" ));	  etat -> utilise_detail_comptes = atoi ( xmlGetProp ( node,							       "Detail_comptes" ));	  etat -> no_comptes = NULL;	  if ( strlen ( xmlGetProp ( node,				     "No_comptes" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"No_comptes" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat ->no_comptes  = g_slist_append ( etat -> no_comptes,							GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }	  etat -> regroupe_ope_par_compte = atoi ( xmlGetProp ( node,								"Grp_ope_compte" ));	  etat -> affiche_sous_total_compte = atoi ( xmlGetProp ( node,								  "Total_compte" ));	  etat -> type_virement = atoi ( xmlGetProp ( node,						      "Type_vir" ));	  if ( strlen ( xmlGetProp ( node,				     "No_comptes_virements" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"No_comptes_virements" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat ->no_comptes_virements  = g_slist_append ( etat -> no_comptes_virements,								  GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }	  etat -> exclure_ope_non_virement = atoi ( xmlGetProp ( node,								 "Exclure_non_vir" ));	  etat -> utilise_categ = atoi ( xmlGetProp ( node,						      "Categ" ));	  etat -> utilise_detail_categ = atoi ( xmlGetProp ( node,							     "Detail_categ" ));	  etat -> no_categ = NULL;	  if ( strlen ( xmlGetProp ( node,				     "No_categ" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"No_categ" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat -> no_categ = g_slist_append ( etat -> no_categ,						      GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }	  etat -> exclure_ope_sans_categ = atoi ( xmlGetProp ( node,							       "Exclut_categ" ));	  etat -> affiche_sous_total_categ = atoi ( xmlGetProp ( node,								 "Total_categ" ));	  etat -> afficher_sous_categ = atoi ( xmlGetProp ( node,							    "Aff_ss_categ" ));	  etat -> afficher_pas_de_sous_categ = atoi ( xmlGetProp ( node,								   "Aff_pas_ss_categ" ));	  etat -> affiche_sous_total_sous_categ = atoi ( xmlGetProp ( node,								      "Total_ss_categ" ));	  etat -> devise_de_calcul_categ = atoi ( xmlGetProp ( node,							       "Devise_categ" ));	  etat -> utilise_ib = atoi ( xmlGetProp ( node,						   "IB" ));	  etat -> utilise_detail_ib = atoi ( xmlGetProp ( node,							  "Detail_ib" ));	  etat -> no_ib = NULL;	  if ( strlen ( xmlGetProp ( node,				     "No_ib" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"No_ib" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat -> no_ib = g_slist_append ( etat -> no_ib,						   GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }	  etat -> exclure_ope_sans_ib = atoi ( xmlGetProp ( node,							    "Exclut_ib" ));	  etat -> affiche_sous_total_ib = atoi ( xmlGetProp ( node,							      "Total_ib" ));	  etat -> afficher_sous_ib = atoi ( xmlGetProp ( node,							 "Aff_ss_ib" ));	  etat -> afficher_pas_de_sous_ib = atoi ( xmlGetProp ( node,								"Aff_pas_ss_ib" ));	  etat -> affiche_sous_total_sous_ib = atoi ( xmlGetProp ( node,								   "Total_ss_ib" ));	  etat -> devise_de_calcul_ib = atoi ( xmlGetProp ( node,							    "Devise_ib" ));	  etat -> utilise_tiers = atoi ( xmlGetProp ( node,						      "Tiers" ));	  etat -> utilise_detail_tiers = atoi ( xmlGetProp ( node,							     "Detail_tiers" ));	  etat -> no_tiers = NULL;	  if ( strlen ( xmlGetProp ( node,				     "No_tiers" )))	    {	      gchar **pointeur_char;	      gint i;	      pointeur_char = g_strsplit ( xmlGetProp ( node,							"No_tiers" ),					   "/",					   0 );	      i=0;	      while ( pointeur_char[i] )		{		  etat -> no_tiers = g_slist_append ( etat -> no_tiers,						      GINT_TO_POINTER ( atoi ( pointeur_char[i] )));		  i++;		}	      g_strfreev ( pointeur_char );	    }	  etat -> affiche_sous_total_tiers = atoi ( xmlGetProp ( node,								 "Total_tiers" ));	  etat -> devise_de_calcul_tiers = atoi ( xmlGetProp ( node,							       "Devise_tiers" ));	  if ( strlen ( xmlGetProp ( node,				     "Texte" )))	    etat -> texte = xmlGetProp ( node,					 "Texte" );	  else	    etat -> texte = NULL;	  etat -> utilise_montant_neg_pos = atoi ( xmlGetProp ( node,								"Montant_n_p" ));	  etat -> type_neg_pos = atoi ( xmlGetProp ( node,						     "Type_n_p" ));	  etat -> utilise_valeur = atoi ( xmlGetProp ( node,						       "Util_val" ));	  etat -> type_operateur_valeur = atoi ( xmlGetProp ( node,							      "Type_ope_val" ));	  etat -> montant_valeur = g_strtod ( xmlGetProp ( node,							   "Montant_val" ),					      NULL );	  etat -> utilise_inclusion = atoi ( xmlGetProp ( node,							  "Util_incl" ));	  etat -> montant_inclusion_inf = g_strtod ( xmlGetProp ( node,								  "Montant_incl_inf" ),						     NULL );	  etat -> type_operateur_inf_inclusion = atoi ( xmlGetProp ( node,								     "Type_ope_incl_inf" ));	  etat -> type_operateur_sup_inclusion = atoi ( xmlGetProp ( node,								     "Type_ope_incl_sup" ));	  etat -> montant_inclusion_sup = g_strtod ( xmlGetProp ( node,								  "Montant_incl_sup" ),						     NULL );	  etat -> choix_montant_nul = atoi ( xmlGetProp ( node,							  "Montant_nul" ));	  	  etat -> choix_devise_montant = atoi ( xmlGetProp ( node,							     "Montant_devise" ));	  liste_struct_etats = g_slist_append ( liste_struct_etats,						etat );	}      node = node -> next;    }  /* on libre la memoire */    xmlFreeDoc ( doc );  /* on rafraichit la liste des tats */   remplissage_liste_etats ();  gtk_widget_set_sensitive ( bouton_effacer_etat,			     TRUE );  modification_fichier ( TRUE );  return ( TRUE );}