Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 4, 2021
1 parent e4f3453 commit a5ed615
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/eez/flow/components/scpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,13 @@ void executeScpiComponent(FlowState *flowState, unsigned componentIndex) {
char *strEnd;
long num = strtol(resultText, &strEnd, 10);
if (*strEnd == 0) {
srcValue = Value(num);
if (num >= INT32_MIN && num <= INT32_MAX) {
srcValue = Value(num, VALUE_TYPE_INT32);
} else if (num >= 0 && num <= UINT32_MAX) {
srcValue = Value(num, VALUE_TYPE_UINT32);
} else {
srcValue = Value(num, VALUE_TYPE_INT64);
}
} else {
float fnum = strtof(resultText, &strEnd);
if (*strEnd == 0) {
Expand Down

0 comments on commit a5ed615

Please sign in to comment.