Skip to content

Commit f1211b9

Browse files
committed
temporarily removed all macros related to mp_to_radix
1 parent a919731 commit f1211b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

demo/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ void ndraw(mp_int *a, const char *name)
77
{
88
char *buf;
99
int size;
10+
size_t length[0];
1011

1112
mp_radix_size(a, 10, &size);
12-
buf = (char *)malloc((size_t) size);
13+
*length = (size_t)size;
14+
buf = (char *)malloc(*length);
1315
if (buf == NULL) {
1416
fprintf(stderr, "\nndraw: malloc(%d) failed\n", size);
1517
exit(EXIT_FAILURE);
1618
}
1719

1820
printf("%s: ", name);
19-
mp_to_decimal(a, buf, (size_t) size);
21+
mp_to_radix(a, buf, length, 10);
2022
printf("%s\n", buf);
21-
mp_to_hex(a, buf, (size_t) size);
23+
mp_to_radix(a, buf, length, 16);
2224
printf("0x%s\n", buf);
2325

2426
free(buf);

0 commit comments

Comments
 (0)