Use epicsScanFloat/epicsScanDouble rather than sscanf.

This allows proper handling of Nan/Inf on all architectures.
This commit is contained in:
W. Eric Norum
2004-10-12 17:45:31 +00:00
parent 25c797b212
commit 0dc034962c
18 changed files with 53 additions and 52 deletions

View File

@@ -17,7 +17,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <epicsStdlib.h>
#include <string.h>
#include <alarm.h>
@@ -358,7 +358,7 @@ int main (int argc, char *argv[])
enumAsNr=1;
break;
case 'w': /* Set CA timeout value */
if(sscanf(optarg,"%lf", &caTimeout) != 1)
if(epicsScanDouble(optarg, &caTimeout) != 1)
{
fprintf(stderr, "'%s' is not a valid timeout value "
"- ignored. ('caget -h' for help.)\n", optarg);

View File

@@ -17,7 +17,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <epicsStdlib.h>
#include <cadef.h>
#include <epicsGetopt.h>
@@ -136,7 +136,7 @@ int main (int argc, char *argv[])
usage();
return 0;
case 'w': /* Set CA timeout value */
if(sscanf(optarg,"%lf", &caTimeout) != 1)
if(epicsScanDouble(optarg, &caTimeout) != 1)
{
fprintf(stderr, "'%s' is not a valid timeout value "
"- ignored. ('caget -h' for help.)\n", optarg);

View File

@@ -17,7 +17,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <epicsStdlib.h>
#include <string.h>
#include <cadef.h>
@@ -205,7 +205,7 @@ int main (int argc, char *argv[])
tsType = incrementalByChan;
break;
case 'w': /* Set CA timeout value */
if(sscanf(optarg,"%lf", &caTimeout) != 1)
if(epicsScanDouble(optarg, &caTimeout) != 1)
{
fprintf(stderr, "'%s' is not a valid timeout value "
"- ignored. ('caget -h' for help.)\n", optarg);

View File

@@ -230,7 +230,7 @@ int main (int argc, char *argv[])
isArray = 1;
break;
case 'w': /* Set CA timeout value */
if(sscanf(optarg,"%lf", &caTimeout) != 1)
if(epicsScanDouble(optarg, &caTimeout) != 1)
{
fprintf(stderr, "'%s' is not a valid timeout value "
"- ignored. ('caput -h' for help.)\n", optarg);