Skip to content

Commit

Permalink
fixing stod conversion according to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gangatp committed Jan 30, 2024
1 parent e77162c commit 06eb11a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ file(GLOB
list(FILTER LIBS_INCLUDE EXCLUDE REGEX "zlib|libzip|libressl")
target_include_directories(${PROJECT_NAME} PRIVATE ${LIBS_INCLUDE})

# allow FASTFLOAT_ALLOWS_LEADING_PLUS
add_definitions(-DFASTFLOAT_ALLOWS_LEADING_PLUS=1)

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Source)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/API)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include)
Expand Down
4 changes: 4 additions & 0 deletions Source/Common/NMR_StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ namespace NMR {
{
throw CNMRException(NMR_ERROR_EMPTYSTRINGTODOUBLECONVERSION);
}
else if (answer.ptr && answer.ptr[0] == ',') // Invalidate comma as decimal separator
{
throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION);

Check warning on line 166 in Source/Common/NMR_StringUtils.cpp

View check run for this annotation

Codecov / codecov/patch

Source/Common/NMR_StringUtils.cpp#L166

Added line #L166 was not covered by tests
}

if ((dResult == HUGE_VAL) || (dResult == -HUGE_VAL))
throw CNMRException(NMR_ERROR_STRINGTODOUBLECONVERSIONOUTOFRANGE);
Expand Down

0 comments on commit 06eb11a

Please sign in to comment.