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