safer this way, keep in mind value_t is a union

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1758 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.2
Stéphane Fillod, F8CFE 2004-06-14 20:57:34 +00:00
rodzic c14c042744
commit e8c987a754
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TS850 description
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: ts850.c,v 1.16 2004-06-14 19:32:26 f4dwv Exp $
* $Id: ts850.c,v 1.17 2004-06-14 20:57:34 fillods Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -505,7 +505,7 @@ int ts850_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char lvlbuf[50];
int lvl_len, retval;
int i, lvl_len, retval;
if(vfo!=RIG_VFO_CURR)
return -RIG_EINVAL;
@ -534,11 +534,11 @@ int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return retval;
lvlbuf[7]='\0';
val->i=atoi(&lvlbuf[3]);
if(val->i == 30)
i=atoi(&lvlbuf[3]);
if(i == 30)
val->f = 150.0; /* infinity :-) */
else
val->f = 60.0/(30.0-(float)val->i)-1.0;
val->f = 60.0/(30.0-(float)i)-1.0;
break;
case RIG_LEVEL_COMP:
lvl_len = 0;