From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Sun, 2 Jan 2022 14:10:51 +0000 (+0530)
Subject: VFO display: attempt to account for the dot
X-Git-Url: https://git.rkrishnan.org/pf/components/vdrive//%22%3C?a=commitdiff_plain;h=618b2bd2da7016c37bb2f990527040ffa45c247d;p=pihpsdr.git

VFO display: attempt to account for the dot
---

diff --git a/vfo.c b/vfo.c
index f2ebe52..bad81d3 100644
--- a/vfo.c
+++ b/vfo.c
@@ -918,14 +918,18 @@ char **draw_vfo_val(char *vfo_str, int step) {
     memset(s2, '\0', 20);
     memset(s3, '\0', 20);
 
-    for (int i = 0; i < l - step - 1; i++) {
+    int step_index = step;
+    if (step == 6) {
+        step_index = step - 1; // to account for the dot
+    }
+    for (int i = 0; i < l - step_index - 1; i++) {
         s1[i] = vfo_str[i];
     }
 
-    s2[0] = vfo_str[l - step - 1];
+    s2[0] = vfo_str[l - step_index - 1];
 
     for (int i = 0; i < step; i++) {
-        s3[i] = vfo_str[l - step + i];
+        s3[i] = vfo_str[l - step_index + i];
     }
 
     s[0] = s1;