This is a workaround for some apps like Gpredict, which use comma as a decimal
separator (depending on locale settings), but sscanf in Hamlib can only handle
dots.
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
Fix declarations after statements
Remove some !rig checks...we either don't need them or need them everywhere with a new error code
If you pass a NULL rig you get what you deserve :-)
This found tons of errors in rig_debug statements
So this patch cleans up all the files that were producing warnings or errors
This should fix a few segfaults when running with debug turned on
The \chk_vfo command to rigctl_parse() accepts an extended response
prefix but does not act upon it, instead it is held over until the
next command. This seems unnecessary as an extended response prefix
can just as easily be added to the following command if required. By
removing this carried over state the processing of commands can be
greatly simplified as per this commit.
The warning was:
CC rotctl_parse.o
../../hamlib/tests/rotctl_parse.c:1012:50: warning: format string is not a string literal (potentially insecure)
[-Wformat-security]
snprintf(cmd_name, sizeof(cmd_name), parsed_input[0] + 1);
^~~~~~~~~~~~~~~~~~~
../../hamlib/tests/rotctl_parse.c:1012:50: note: treat the string as an argument to avoid this
snprintf(cmd_name, sizeof(cmd_name), parsed_input[0] + 1);
^
"%s",
1 warning generated.
This makes the first non-option argument end getopt_long() parsing
stop rather than shuffling non-option arguments to the end. This is
necessary so that rig/rotator command language arguments can start
with a '-' character and also it enables the '-' pseudo command to
switch to reading commands from stdin work correctly.
The change also make checking for the '-', switch to stdin, command
stricter in that it must be where a command is expected and it must be
a word containing exactly a single '-' character.
Overall this allows the following styles of use:
$ rigctl R -
$ rigctl - <<EOF
>R -
>EOF
R -
$ echo "R -" | rigctl -
R -
$ rigctl -m 1 M CW -1
$ rigctl F 434000000 - <<EOF
>M FM 15000
>f m
>EOF
M FM 15000
f 145000000
m FM
15000
$
as well as the command line interpreter operation where no commands
nor '-' are provided:
$ rigctl
Rig command: R -
Rig command: r
Rptr Shift: -
Rig command: f
Frequency: 145000000
Rig command: m
Mode: FM
Passband: 15000
Rig command: F 434000000
Rig command: f
Frequency: 434000000
Rig command: q
$