aboutsummaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-24 09:52:43 -0700
committerChristian Cunningham <cc@localhost>2022-03-24 09:52:43 -0700
commit22e4f3def524d787316b40f46e66ec0455d1ed52 (patch)
tree66ff4a43b6a3102f541d679c7ce13ccd650bffa5 /usr
parentd91b1f275e7a62fa5787df49769238c29c605a91 (diff)
Seconds delimiter
Diffstat (limited to 'usr')
-rw-r--r--usr/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/main.c b/usr/main.c
index 7091580..3543c31 100644
--- a/usr/main.c
+++ b/usr/main.c
@@ -5,7 +5,7 @@ char* ulong_to_string(unsigned long value, char* data)
{
unsigned long t = value;
unsigned long c;
- char* dptr = data + 9;
+ char* dptr = data + 10;
for (int i = 0; i <= 10; i++) {
c = t%10;
*dptr = 0x30 + (c&0xF);
@@ -13,6 +13,10 @@ char* ulong_to_string(unsigned long value, char* data)
if (t==0)
break;
dptr -= 1;
+ if (i == 5) {
+ *dptr = '.';
+ dptr -= 1;
+ }
}
return dptr;
}