diff options
| -rw-r--r-- | lib/fonctions.c | 17 | ||||
| -rw-r--r-- | po/cat-id-tbl.c | 2 | ||||
| -rw-r--r-- | src/Polynom.c | 2 | 
3 files changed, 9 insertions, 12 deletions
diff --git a/lib/fonctions.c b/lib/fonctions.c index f133c98..dee16a8 100644 --- a/lib/fonctions.c +++ b/lib/fonctions.c @@ -46,14 +46,14 @@ void appel_fonction(char *nom, int arite, polynome p1, polynome p2, polynome p3)  	int i=0;  	int trouve = 0; -	while (func_table[i].nom) { -		if( strcmp(func_table[i].nom, nom)) +	while ((func_table[i].nom)&&(!trouve)) { +		if(!strcmp(func_table[i].nom, nom))  			trouve = 1;  	i++;  	}	  	if (trouve) { -		if (func_table[i].arite==arite) { -			(*func_table[i].func)(p1, p2, p3); +		if (func_table[i-1].arite==arite) { +			(*func_table[i-1].func)(p1, p2, p3);  		} else {  			exception(1,_("appel_fonction: incorrect arg number"));  		}	 @@ -64,16 +64,13 @@ void appel_fonction(char *nom, int arite, polynome p1, polynome p2, polynome p3)  } - - -  void deriv(polynome p1, polynome p2, polynome p3)  {  	polynome resultat = NULL, temp = NULL, t;  	while (p1) {   		if (p1->degre) { - 			t=ply_constr(rat_constr((p1->coef.num)*(p1->coef.degre), p1->coef.denom), (p1->degre-1)); + 			t=ply_constr(rat_constr((p1->coef.num)*(p1->degre), p1->coef.denom), (p1->degre-1));          		        if (t) {  					if (resultat) {  						temp->suiv = t; @@ -98,7 +95,7 @@ void derivn(polynome p1, polynome p2, polynome p3)  			push_pile_poly(p2);  			for(i=0; i<p1->coef.num; i++) {  				temp=pop_pile(1); -				deriv(elemtemp.poly); +				deriv(temp.poly, NULL, NULL);  			}  		} else {  			exception(1,_("derivn: invalid 2nd arg")); @@ -114,7 +111,7 @@ void integ(polynome p1, polynome p2, polynome p3)  	while (p1) {  - 		t=ply_constr(rat_constr((p1->coef.num), (p1->coef.denom)*(p1->coef.degre+1)), (p1->degre+1)); + 		t=ply_constr(rat_constr((p1->coef.num), (p1->coef.denom)*(p1->degre+1)), (p1->degre+1));          	if (t) {  			if (resultat) {  				temp->suiv = t; diff --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c index e306c13..56a192f 100644 --- a/po/cat-id-tbl.c +++ b/po/cat-id-tbl.c @@ -73,7 +73,7 @@ Starting interface...\n\  \n\  Performing shutdown...\n\  \n", 57}, -  {"Exitting, bye!\n", 58}, +  {"Exiting, bye!\n", 58},  };  int _msg_tbl_length = 58; diff --git a/src/Polynom.c b/src/Polynom.c index 5a52228..f9487e7 100644 --- a/src/Polynom.c +++ b/src/Polynom.c @@ -96,7 +96,7 @@ int main(void)      signal(SIGSEGV, NULL);      signal(SIGINT, NULL); -    fprintf(stderr, _("Exitting, bye!\n")); +    fprintf(stderr, _("Exiting, bye!\n"));  	return 0;  }  | 
