Fix segfault on improper -C syntax

Avoid null pointer segfault when -C param is specified with no '=' e.g.
"rigctl -C foo".

Thanks to Charles Suprin <hamaa1vs@gmail.com> for the report.



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@3058 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.13
Kamal Mostafa, KA6MAL 2011-02-21 19:32:00 +00:00
rodzic 6de8bb5089
commit cf276991f2
6 zmienionych plików z 18 dodań i 6 usunięć

Wyświetl plik

@ -91,7 +91,9 @@ int set_conf(RIG *my_rig, char *conf_parms)
while (p && *p != '\0') {
/* FIXME: left hand value of = cannot be null */
q = strchr(p, '=');
if (q) *q++ = '\0';
if ( !q )
return RIG_EINVAL;
*q++ = '\0';
n = strchr(q, ',');
if (n) *n++ = '\0';

Wyświetl plik

@ -661,7 +661,9 @@ int set_conf(RIG *my_rig, char *conf_parms)
while (p && *p != '\0') {
/* FIXME: left hand value of = cannot be null */
q = strchr(p, '=');
if (q) *q++ = '\0';
if ( !q )
return RIG_EINVAL;
*q++ = '\0';
n = strchr(q, ',');
if (n) *n++ = '\0';

Wyświetl plik

@ -347,7 +347,9 @@ int set_conf(RIG *rig, char *conf_parms)
while (p && *p != '\0') {
/* FIXME: left hand value of = cannot be null */
q = strchr(p, '=');
if (q) *q++ = '\0';
if ( !q )
return RIG_EINVAL;
*q++ = '\0';
n = strchr(q, ',');
if (n) *n++ = '\0';

Wyświetl plik

@ -355,7 +355,9 @@ int set_conf_rig(RIG *rig, char *conf_parms)
while (p && *p != '\0') {
/* FIXME: left hand value of = cannot be null */
q = strchr(p, '=');
if (q) *q++ = '\0';
if ( !q )
return RIG_EINVAL;
*q++ = '\0';
n = strchr(q, ',');
if (n) *n++ = '\0';

Wyświetl plik

@ -303,7 +303,9 @@ int set_conf(RIG *rig, char *conf_parms)
while (p && *p != '\0') {
/* FIXME: left hand value of = cannot be null */
q = strchr(p, '=');
if (q) *q++ = '\0';
if ( !q )
return RIG_EINVAL;
*q++ = '\0';
n = strchr(q, ',');
if (n) *n++ = '\0';

Wyświetl plik

@ -555,7 +555,9 @@ int set_conf(ROT *my_rot, char *conf_parms)
while (p && *p != '\0') {
/* FIXME: left hand value of = cannot be null */
q = strchr(p, '=');
if (q) *q++ = '\0';
if ( !q )
return RIG_EINVAL;
*q++ = '\0';
n = strchr(q, ',');
if (n) *n++ = '\0';