--- rpl/src/formateur_fichiers.c 2011/11/15 07:01:37 1.34 +++ rpl/src/formateur_fichiers.c 2013/03/08 14:55:38 1.51 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.4 - Copyright (C) 1989-2011 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.13 + Copyright (C) 1989-2013 Dr. BERTRAND Joël This file is part of RPL/2. @@ -75,8 +75,6 @@ formateur_fichier(struct_processus *s_et logical1 autorisation_parenthese; logical1 format_degenere; - logical1 longueur_3bits; - logical1 longueur_6bits; logical1 presence_signe; struct_liste_chainee *l_atome; @@ -97,16 +95,12 @@ formateur_fichier(struct_processus *s_et unsigned char *chaine_tampon; unsigned char *chaine_sauvegarde; unsigned char *format_chaine; - unsigned char longueur_optimale; - unsigned char parametre_longueur; unsigned char *ptre; unsigned char *ptrl; unsigned char tampon[64 + 1]; unsigned long i; unsigned long j; - unsigned long longueur_binaire; - unsigned long longueur_champ_final; unsigned long nombre_arguments; unsigned long nombre_arguments_fonction; unsigned long nombre_colonnes; @@ -114,16 +108,12 @@ formateur_fichier(struct_processus *s_et unsigned long nombre_lignes; integer8 longueur_liste; - integer8 longueur_entete; - integer8 longueur_objet; integer8 longueur_totale; integer8 masque_binaire; integer8 position_1; integer8 position_2; integer8 position_3; - long offset; - (*recursivite)++; if (type == 'F') @@ -138,7 +128,6 @@ formateur_fichier(struct_processus *s_et strcpy(base, " "); - longueur_binaire = 0; masque_binaire = 0; if ((*s_objet).type == ALG) @@ -998,7 +987,6 @@ formateur_fichier(struct_processus *s_et return(NULL); } - longueur_binaire = longueur_entiers_binaires(s_etat_processus); masque_binaire = masque_entiers_binaires(s_etat_processus); if ((test_cfsf(s_etat_processus, 43) == d_faux) && @@ -1508,8 +1496,19 @@ formateur_fichier(struct_processus *s_et return(NULL); } - position_3 = strlen(format_chaine); - format_chaine[--position_3] = d_code_fin_chaine; + position_3 = strlen(format_chaine) - 1; + + if (format_chaine[position_3] != ')') + { + free(chaine); + free(format_chaine); + + (*s_etat_processus).erreur_execution = + d_ex_erreur_format_fichier; + return(NULL); + } + + format_chaine[position_3] = d_code_fin_chaine; position_2 = position_1; @@ -2731,9 +2730,9 @@ formateur_fichier(struct_processus *s_et * Longueur : (pour l'instruction backspace) * * 00 XXXXXX longueur sur 6 bits - * 01 XXXXXX longueur sur 16 bits - * 10 XXXXXX longueur sur 32 bits - * 11 XXXXXX longueur sur 64 bits + * 01 000000 longueur sur 16 bits + * 10 000000 longueur sur 32 bits + * 11 000000 longueur sur 64 bits * * Exemples : * [00 XXXXXX] @@ -2873,7 +2872,6 @@ formateur_fichier(struct_processus *s_et strcpy(base, " "); - longueur_binaire = 0; masque_binaire = 0; if ((*s_objet).type == ALG) @@ -3733,7 +3731,6 @@ formateur_fichier(struct_processus *s_et return(NULL); } - longueur_binaire = longueur_entiers_binaires(s_etat_processus); masque_binaire = masque_entiers_binaires(s_etat_processus); if ((test_cfsf(s_etat_processus, 43) == d_faux) && @@ -3928,6 +3925,7 @@ formateur_fichier(struct_processus *s_et /* -------------------------------------------------------------------------------- Complexe + Poids fort 0001 10 -------------------------------------------------------------------------------- */ @@ -4032,6 +4030,7 @@ formateur_fichier(struct_processus *s_et /* -------------------------------------------------------------------------------- Entier + Poids fort 0001 00 -------------------------------------------------------------------------------- */ @@ -5225,6 +5224,7 @@ formateur_fichier(struct_processus *s_et /* -------------------------------------------------------------------------------- Réel + Poids fort 0001 01 -------------------------------------------------------------------------------- */ @@ -5845,6 +5845,7 @@ formateur_fichier_reel(struct_processus } } } + strcpy(chaine, tampon); } @@ -6207,3 +6208,5 @@ formateur_fichier_binaire_nombre(struct_ return(chaine); } + +// vim: ts=4