mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 01:07:34 +02:00
Fix bug zero-terminating truncated string
This commit is contained in:
parent
4091dc4662
commit
92ec4a0b7f
2 changed files with 6 additions and 3 deletions
|
@ -2537,7 +2537,7 @@ void bignum2string(void *data, object cont, bignum2_type *bn, int radix)
|
|||
i = str_length - (index - buf);
|
||||
s->len = s->num_cp = i;
|
||||
memmove(buf, index, i);
|
||||
buf[str_length-1] = '\0';
|
||||
s->str[i] = '\0';
|
||||
}
|
||||
}
|
||||
return_closcall1(data, cont, s);
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
bignum2string(data, k, bn, obj_obj2int(radix));
|
||||
")
|
||||
|
||||
(write
|
||||
(map
|
||||
(lambda (row)
|
||||
(write row)
|
||||
(newline))
|
||||
(list
|
||||
(test-larger-bn 0 #x0FFF0001 10) ;; TODO: why is this not writing the correct number?
|
||||
(test-larger-bn 0 #x0FFF0001 10)
|
||||
(test-bn #x0FFF0001 10)
|
||||
|
||||
(test-bn -10 10)
|
||||
|
|
Loading…
Add table
Reference in a new issue