kopia lustrzana https://github.com/Hamlib/Hamlib
Fix segfault in flrig.c
rodzic
5b5e39d86f
commit
505273e123
|
@ -943,8 +943,10 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
|
|
||||||
// Set the mode
|
// Set the mode
|
||||||
char *ttmode = strdup(modeMapGetFLRig(mode));
|
char *ttmode = strdup(modeMapGetFLRig(mode));
|
||||||
if (ttmode[0]=='|') ttmode = &ttmode[1]; // remove first pipe symbol
|
rig_debug(RIG_DEBUG_TRACE,"%s: got ttmode = %s\n",__FUNCTION__,ttmode==NULL?"NULL":ttmode);
|
||||||
char *p=strchr(ttmode,'|');
|
char *pttmode = ttmode;
|
||||||
|
if (ttmode[0]=='|') pttmode = &ttmode[1]; // remove first pipe symbol
|
||||||
|
char *p=strchr(pttmode,'|');
|
||||||
if (p) *p=0; // remove any other pipe
|
if (p) *p=0; // remove any other pipe
|
||||||
|
|
||||||
char cmd_buf[MAXCMDLEN];
|
char cmd_buf[MAXCMDLEN];
|
||||||
|
@ -963,11 +965,13 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
pxml = xml_build(cmd, cmd_buf, xml, sizeof(xml));
|
pxml = xml_build(cmd, cmd_buf, xml, sizeof(xml));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rig_debug(RIG_DEBUG_TRACE,"%s: write_transaction\n",__FUNCTION__);
|
||||||
retval = write_transaction(rig, pxml, strlen(pxml));
|
retval = write_transaction(rig, pxml, strlen(pxml));
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rig_debug(RIG_DEBUG_TRACE,"%s: read_transaction\n",__FUNCTION__);
|
||||||
// Get the response
|
// Get the response
|
||||||
read_transaction(rig, xml, sizeof(xml));
|
read_transaction(rig, xml, sizeof(xml));
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: response=%s\n", __FUNCTION__,xml);
|
rig_debug(RIG_DEBUG_TRACE, "%s: response=%s\n", __FUNCTION__,xml);
|
||||||
|
|
Ładowanie…
Reference in New Issue