kopia lustrzana https://github.com/Hamlib/Hamlib
Fix gp2000_get_mode bogus sscanf -- potential seg fault function would not work
rodzic
ee56688003
commit
3e3436bdce
|
@ -237,7 +237,7 @@ gp2000_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
int buf_len, retval;
|
||||
int nmode;
|
||||
char *pmode = "UNKNOWN";
|
||||
int n = sscanf(buf, "%*cI%d", &nmode);
|
||||
int n;
|
||||
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
@ -252,8 +252,11 @@ gp2000_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return retval;
|
||||
}
|
||||
|
||||
n = sscanf(buf, "%*cI%d", &nmode);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unable to parse mode from '%s'\n", __func__, buf);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#define _XK2000_H 1
|
||||
|
||||
#undef BACKEND_VER
|
||||
#define BACKEND_VER "20180307"
|
||||
#define BACKEND_VER "20210901"
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue