kopia lustrzana https://github.com/Hamlib/Hamlib
Fix up some cppcheck warnings in rotctl_parse.c
rodzic
2e73c6ac47
commit
4cc80fa603
|
@ -240,7 +240,7 @@ struct test_table *find_cmd_entry(int cmd)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= MAXNBOPT || test_list[i].cmd == 0x00)
|
if (test_list[i].cmd == 0x00)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -517,8 +517,10 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
char arg2[MAXARGSZ + 1], *p2 = NULL;
|
char arg2[MAXARGSZ + 1], *p2 = NULL;
|
||||||
char arg3[MAXARGSZ + 1], *p3 = NULL;
|
char arg3[MAXARGSZ + 1], *p3 = NULL;
|
||||||
char arg4[MAXARGSZ + 1], *p4 = NULL;
|
char arg4[MAXARGSZ + 1], *p4 = NULL;
|
||||||
|
#ifdef __USEP5P6__
|
||||||
char *p5 = NULL;
|
char *p5 = NULL;
|
||||||
char *p6 = NULL;
|
char *p6 = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* cmd, internal, rotctld */
|
/* cmd, internal, rotctld */
|
||||||
if (!(interactive && prompt && have_rl))
|
if (!(interactive && prompt && have_rl))
|
||||||
|
@ -1428,8 +1430,13 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
p2 ? p2 : "",
|
p2 ? p2 : "",
|
||||||
p3 ? p3 : "",
|
p3 ? p3 : "",
|
||||||
p4 ? p4 : "",
|
p4 ? p4 : "",
|
||||||
|
#ifdef __USEP5P6__
|
||||||
p5 ? p5 : "",
|
p5 ? p5 : "",
|
||||||
p6 ? p6 : "");
|
p6 ? p6 : "");
|
||||||
|
#else
|
||||||
|
"",
|
||||||
|
"");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PTHREAD
|
#ifdef HAVE_PTHREAD
|
||||||
pthread_mutex_unlock(&rot_mutex);
|
pthread_mutex_unlock(&rot_mutex);
|
||||||
|
@ -1447,15 +1454,12 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
resp_sep = '\n';
|
resp_sep = '\n';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (cmd_entry != NULL)
|
|
||||||
{
|
{
|
||||||
if (cmd_entry->name != NULL) {
|
if (cmd_entry->name != NULL) {
|
||||||
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* only for rotctld */
|
/* only for rotctld */
|
||||||
|
@ -1471,7 +1475,6 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
else if (ext_resp && cmd != 0xf0)
|
else if (ext_resp && cmd != 0xf0)
|
||||||
{
|
{
|
||||||
fprintf(fout, NETROTCTL_RET "0\n");
|
fprintf(fout, NETROTCTL_RET "0\n");
|
||||||
ext_resp = 0;
|
|
||||||
resp_sep = '\n';
|
resp_sep = '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue