Fix the printing of integers.

Because yes, multiples of 10 would not print...

Change-Id: Id58305086d499eb091ea5612fedcc5ec6f25c415
This commit is contained in:
Felix Raimundo
2016-04-05 13:01:42 +02:00
parent 5c96e04a6a
commit 7a7df647f3

View File

@@ -326,7 +326,8 @@ ExpressionLayout * Integer::createLayout() {
Integer base = Integer(10);
Division d = Division(*this, base);
int size = 0;
while (!(d.m_remainder == Integer((native_int_t)0))) {
while (!(d.m_remainder == Integer((native_int_t)0) &&
d.m_quotient == Integer((native_int_t)0))) {
assert(size<255); //TODO: malloc an extra buffer
char c = char_from_digit(d.m_remainder.m_digits[0]);
buffer[size++] = c;