aboutsummaryrefslogtreecommitdiffstats
path: root/foci.c
diff options
context:
space:
mode:
Diffstat (limited to 'foci.c')
-rw-r--r--foci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/foci.c b/foci.c
index 107d317..8dedfbd 100644
--- a/foci.c
+++ b/foci.c
@@ -53,7 +53,7 @@ NAKED void compname(void)
}
RESTORE;
- *--sp = *(unsigned char *)here;
+ *--sp = *(unsigned char *)here + 1;
NEXT;
}
@@ -172,18 +172,21 @@ static void dotimpl(intptr_t n)
{
static const char dottbl[16] = "0123456789abcdef";
static char dotbuf[16] = {0};
- int i;
+ int i = 0;
if (n < 0) {
n *= -1;
foci_putchar('-');
}
- for (i = 0; n > 0; n /= 10)
+ do {
dotbuf[i++] = dottbl[n % BASE];
+ n /= BASE;
+ } while (n);
while (--i >= 0)
foci_putchar(dotbuf[i]);
+
foci_putchar(' ');
}