Return to inout.c CVS log | Up to [local] / src / usr.bin / dc |
version 1.1, 2003/09/19 17:58:25 | version 1.2, 2003/09/19 19:00:36 | ||
---|---|---|---|
|
|
||
char *p; | char *p; | ||
if (base <= 16) { | if (base <= 16) { | ||
p = bmalloc(2); | p = bmalloc(2); | ||
p[0] = num >= 10 ? num + 'A' - 10 : num + '0'; | p[0] = num >= 10 ? num + 'A' - 10 : num + '0'; | ||
p[1] = '\0'; | p[1] = '\0'; | ||
} else { | } else { | ||
if (asprintf(&p, "%0*lu", digits, num) == -1) | if (asprintf(&p, "%0*lu", digits, num) == -1) |