aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roman.c2
-rw-r--r--test.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/roman.c b/roman.c
index 6606e25..d669cc2 100644
--- a/roman.c
+++ b/roman.c
@@ -52,7 +52,7 @@ dectoroman(int n, char *buf, ulong len)
n -= decimal[i];
}
}
- buf[len-1] = 0;
+ buf[o] = 0;
return 0;
}
diff --git a/test.c b/test.c
index fb71a58..d0532d8 100644
--- a/test.c
+++ b/test.c
@@ -29,7 +29,7 @@ main(int argc, char *argv[])
if(argc != 0)
usage();
- if(decimal >= 0){
+ if(decimal > 0){
if(dectoroman(decimal, buf, sizeof buf) < 0)
sysfatal("dectoroman: %r");
print("%s\n", buf);