From 51a7864b4b789583ea445af47324a9b613336162 Mon Sep 17 00:00:00 2001 From: biouman Date: Mon, 30 Apr 2001 01:21:20 +0000 Subject: *** empty log message *** --- lib/polynom.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib/polynom.c') diff --git a/lib/polynom.c b/lib/polynom.c index 4c789dd..aca2f6c 100644 --- a/lib/polynom.c +++ b/lib/polynom.c @@ -18,7 +18,7 @@ #define _(x) x #endif -/* FIXME: manque div et mod et poly_to_string */ +/* FIXME: manque div et mod */ polynome ply_constr(rationnel coef, int degre) { /* constructeur monome */ @@ -271,8 +271,9 @@ double ply_valuation(polynome poly, double point) char *ply_affichage(polynome poly) { /* routine d'affichage d'un polynome */ - char buf[BUFSIZ] = {0}, temp[BUFSIZ]; /* FIXME: pas glop comme routine, malloquer tout ca ? */ - + char buf[BUFSIZ] = {0}, temp[BUFSIZ]; + int count=0; + while (poly) { if (poly->degre != 0) { if (poly->coef.denom==1) @@ -285,11 +286,12 @@ char *ply_affichage(polynome poly) else sprintf(temp, "%+d/%d ", poly->coef.num , poly->coef.denom); } - strcat(buf, temp); /* FIXME: gerer le depassement de buf si po malloc */ + count+=strlen(temp); + if (countsuiv; - - - } return Estrdup(buf); } -- cgit v1.2.3