From 0837b166d9cda92f4f82aa0f922c8a871fedb695 Mon Sep 17 00:00:00 2001 From: Thomas Beierlein Date: Fri, 8 Nov 2019 15:08:52 +0100 Subject: [PATCH] Fix decrementing the wrong band count when deleting a qso. Fixes also a long standing bug when deleting a comment line. Fixes issue #138 --- src/deleteqso.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/deleteqso.c b/src/deleteqso.c index 4a1f24db2..77ccb9ed7 100644 --- a/src/deleteqso.c +++ b/src/deleteqso.c @@ -40,6 +40,7 @@ #include "tlf_curses.h" #include "scroll_log.h" #include "ui_utils.h" +#include "addcall.h" #define QTCRECVCALLPOS 30 #define QTCSENTCALLPOS 35 @@ -168,8 +169,9 @@ void delete_qso(void) { fsync(lfile); close(lfile); - if (qsos[nr_qsos][0] != ';') { - band_score[bandinx]--; + if (qsos[nr_qsos-1][0] != ';') { + int band = get_band(qsos[nr_qsos-1]); + band_score[band]--; qsonum--; qsonr_to_str(); }