better error handling

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2725 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.10
Stéphane Fillod, F8CFE 2009-09-14 07:30:08 +00:00
rodzic eaf810ea3a
commit bbaa1fe0f4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -150,10 +150,10 @@ gs232a_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
retval = gs232a_transaction(rot, "C2" EOM, posbuf, sizeof(posbuf));
if (retval != RIG_OK || strlen(posbuf) < 10) {
return retval;
return retval < 0 ? retval : -RIG_EPROTO;
}
/* parse */
/* parse "+0aaa+0eee" */
if (sscanf(posbuf+2, "%d", &angle) != 1) {
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s'\n", __FUNCTION__, posbuf);
return -RIG_EPROTO;