Use epicsScanFloat/epicsScanDouble rather than sscanf.
This allows proper handling of Nan/Inf on all architectures.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user