Changeset 0acf3e in git for libpolys/coeffs/rmodulon.cc


Ignore:
Timestamp:
Dec 5, 2013, 4:29:00 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5a0dde71de01068fad5736a17555c993ecbbf495')
Children:
867a0d61fbf7341926f962e8afb0e93257ff5745
Parents:
45cc51208cc1a51b7dc57d423a1031cd515be1c2
Message:
fix: more charstr stuff (tr.237)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/rmodulon.cc

    r45cc512 r0acf3e  
    4949static char* nrnCoeffString(const coeffs r)
    5050{
    51   char* s = (char*) omAlloc(7+11+2);
    52   sprintf(s,"integer,%lu",r->modExponent);
     51  long l = (long)mpz_sizeinbase(r->modBase, 10) + 2;
     52  char* b = (char*) omAlloc(l);
     53  b= mpz_get_str (b, 10, r->modBase);
     54  char* s = (char*) omAlloc(7+2+l);
     55  sprintf(s,"integer,%s",b);
     56  omFreeSize(b,l);
    5357  return s;
    5458}
Note: See TracChangeset for help on using the changeset viewer.