]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
VFO display: attempt to account for the dot
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sun, 2 Jan 2022 14:10:51 +0000 (19:40 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sun, 2 Jan 2022 14:10:51 +0000 (19:40 +0530)
vfo.c

diff --git a/vfo.c b/vfo.c
index f2ebe5273012611c43a0bcb60782b0f5bf3f48fe..bad81d3f07e61b2a162b2f60dab8fdea400b7de9 100644 (file)
--- 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;