hamlib/rigs
Daniele Forsi IU5HKX f88beb1a8e
Fix segfault when executing the dump_caps command
Need to convert the level number 0..63 to the level bit mask.
Steps to reproduce
tests/rigctld -m 1 &
tests/rigctl -m 2 dump_caps

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 [..]
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:174
 #1  0x00007f532c46e300 in __printf_buffer (buf=buf@entry=0x7ffc320ad970, format=0x7f532c8aba22 "%s(%s) ", ap=0x7ffc320ada30, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 #2  0x00007f532c491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc320ada30, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 #3  0x00007f532c469642 in __GI___snprintf (
     s=s@entry=0x7ffc320aec94 "BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0.000000/0.000000) PBT_IN(0.000000..0.000000/0.000000) PBT_OUT(0.000000..0.000000/0.000000) CWPITCH(0..0/10) RFPOWER(0.050000..1.000000/0.001957) MICG"...,
     maxlen=maxlen@entry=3948, format=format@entry=0x7f532c8aba22 "%s(%s) ") at ./stdio-common/snprintf.c:31
 #4  0x00007f532c6dc14a in rig_sprintf_parm_gran (
     str=str@entry=0x7ffc320aec00 "ANN(0..0/0) APO(0..0/0) BACKLIGHT(0..0/0) BEEP(0..1316880384/1315832322) TIME(0..0/0) BAT(0..0/0) KEYLIGHT(0..0/0) SCREENSAVER(0..4/0) AFIF(0..0/0) BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0."...,
     nlen=nlen@entry=4096, parm=9223372036854775807, gran=gran@entry=0x55f1f3cac338) at sprintflst.c:646
 #5  0x000055f1eb6cd487 in dumpstate (rig=rig@entry=0x55f1f3ca5b20, fout=fout@entry=0x7f532c5f25c0 <_IO_2_1_stdout_>) at dumpstate.c:408
 #6  0x000055f1eb6b4b81 in rigctl_dump_caps (rig=0x55f1f3ca5b20, fout=0x7f532c5f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0,
     resp_sep=10 '\n', cmd=0x55f1eb6dc0e0 <test_list+5760>, vfo=536870912, arg1=0x0, arg2=0x55f1eb6d1ce8 "", arg3=0x55f1eb6d1ce8 "") at rigctl_parse.c:4622
 #7  0x000055f1eb6c65f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc320b2138, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>,
     vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847
 #8  0x000055f1eb6b0adc in main (argc=<optimized out>, argv=0x7ffc320b2138) at rigctl.c:801
2025-08-12 11:50:20 -05:00
..
adat Start converting rigs/* to use pointers to state 2024-03-26 02:08:33 -04:00
alinco Convert all of rigs/* except rigs/icom and rigs/yaesu 2024-06-05 21:07:06 -04:00
anytone Start converting rigs/* to use pointers to state 2024-03-26 02:08:33 -04:00
aor Fix Doxygen tags 2025-06-06 21:23:24 -05:00
barrett astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
codan Fix typos 2025-04-26 20:50:14 +02:00
commradio astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
dorji More pointers to state 2024-03-26 02:08:33 -04:00
drake Convert all of rigs/* except rigs/icom and rigs/yaesu 2024-06-05 21:07:06 -04:00
dummy Fix segfault when executing the dump_caps command 2025-08-12 11:50:20 -05:00
elad Fix typos 2025-05-22 21:55:10 +02:00
flexradio smartsdr--CWX Updates 2025-07-07 21:44:54 -05:00
gomspace More sed -i with manual fixups. 2024-06-05 16:50:40 -04:00
icmarine Fix typos in comments 2024-11-24 19:24:35 +01:00
icom Fix one byte buffer overrun 2025-08-06 13:46:13 -05:00
jrc Fixed jrc_set_chan 2025-06-20 21:27:28 -05:00
kachina astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
kenwood Update Kenwood max CW message size. 2025-08-06 13:45:57 -05:00
kit Merge GitHub PR #1742 2025-05-22 18:17:59 -05:00
lowe Use sed -i on all in rigs/kit/ 2024-06-05 16:50:40 -04:00
mds astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
motorola astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
pcr astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
prm80 Balance ENTERFUNC/RETURNFUNC usage 2024-06-26 10:16:12 -04:00
racal astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
rft And another batch... 2024-06-05 16:50:40 -04:00
rs astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
skanti And another batch... 2024-06-05 16:50:40 -04:00
tapr And another batch... 2024-06-05 16:50:40 -04:00
tentec Fix typos in comments 2024-11-24 19:24:35 +01:00
tuner More state pointers - mostly sed i 2024-06-05 16:50:40 -04:00
uniden Fix typos 2025-05-22 21:55:10 +02:00
winradio astyle files in preparation for release 4.6 2024-11-06 08:07:34 -06:00
wj Fix typos 2025-05-22 21:55:10 +02:00
yaesu Fix backward frequency tests in ft857.c 2025-05-29 12:38:19 -05:00
hamlib_voice_cw_memory_4.6.0.xlsx Add notes on voice memory for rigs 2023-12-21 08:13:41 -06:00