[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 5d81ea38bbdfd92e68099
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-04-22 03:04:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 5d81ea38bbdfd92e680995057b8ed46f53f5a8d8 (commit) via 923a789c29ad81abfbb7149f80cebd51afc6b756 (commit) from 9aed2637a63abb8b175a21b06942cca5308e7527 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5d81ea38bbdfd92e680995057b8ed46f53f5a8d8 Merge: 9aed2637a 923a789c2 Author: Nate Bargmann <n0...@n0...> Date: Mon Apr 21 22:03:00 2025 -0500 Merge pull request #1710 from N0NB/aclog_get_freq-thousands_separator Fix sscanf() truncating input from thousands separator commit 923a789c29ad81abfbb7149f80cebd51afc6b756 Author: Nate Bargmann <n0...@n0...> Date: Mon Apr 21 21:27:55 2025 -0500 Fix sscanf() truncating input from thousands separator Per Github issue #1704, N3FJP logger sends a string with an embedded comma for frequencies above 1 GHz resulting in such frequencies being truncated. This patch uses the optional apostrophe character in the sscanf() format string to ignore the thousands separator. A possible bug is when the locale of the system on which libhamlib is executing uses a dot for the thousands separator rather than a comma. It is unclear if the N3FJP software obeys such locales or not. If this turns out to be an issue then this fix will need to be reconsidered. diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c index 3e0f69803..8baeef075 100644 --- a/rigs/dummy/aclog.c +++ b/rigs/dummy/aclog.c @@ -461,7 +461,7 @@ static int aclog_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) char *p = strstr(value, "<FREQ>"); *freq = 0; - if (p) { sscanf(p, "<FREQ>%lf", freq); } + if (p) { sscanf(p, "<FREQ>%'lf", freq); } *freq *= 1e6; // convert from MHz to Hz ----------------------------------------------------------------------- Summary of changes: rigs/dummy/aclog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |