diff --git a/extern/decNumber/decCommon.c b/extern/decNumber/decCommon.c index 6a0c112c88..e16d6ee2d1 100644 --- a/extern/decNumber/decCommon.c +++ b/extern/decNumber/decCommon.c @@ -236,6 +236,7 @@ static decFloat * decFinalize(decFloat *df, bcdnum *num, uByte *ulsd=num->lsd; // .. uInt encode; // encoding accumulator Int length; // coefficient length + uByte buffer[ROUNDUP(DECPMAX+3, 4)]; // [+3 allows uInt padding] #if DECCHECK Int clen=ulsd-umsd+1; @@ -456,7 +457,6 @@ static decFloat * decFinalize(decFloat *df, bcdnum *num, // fold down needed; must copy to buffer in order to pad // with zeros safely; fortunately this is not the worst case // path because cannot have had a round - uByte buffer[ROUNDUP(DECPMAX+3, 4)]; // [+3 allows uInt padding] uByte *s=umsd; // source uByte *t=buffer; // safe target uByte *tlsd=buffer+(ulsd-umsd)+shift; // target LSD @@ -905,16 +905,20 @@ decFloat * decFloatFromString(decFloat *result, const char *string, else { // too long for buffer // [This is a rare and unusual case; arbitrary-length input] // strip leading zeros [but leave final 0 if all 0's] - if (*cfirst=='.') cfirst++; // step past dot at start - if (*cfirst=='0') { // [cfirst always -> digit] - for (; cfirst