Skip to content
Snippets Groups Projects
Commit fcbef536 authored by Luc Hermitte's avatar Luc Hermitte
Browse files

BUG: Replace `atoi`->`std::stoi`->`otb::to<>`

- `atoi` is a known source of problems
- `stoi` doesn't provide much context for non (int-)convertible strings
parent 29dd6a6f
No related branches found
No related tags found
1 merge request!1Resolve "Adapt DiapOTB SARCartesianMeanEstimation to keep shadows"
......@@ -23,6 +23,7 @@
#include "otbSARDEMPolygonsAnalysisImageFilter2.h"
#include "otbStringUtilities.h"
#include "otbVectorImage.h"
#include "itkImageScanlineConstIterator.h"
......@@ -229,7 +230,7 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
}
else
{
mapRequiredComponents[requiredComponent] = std::stoi(inputKwl.GetMetadataByKey(component));
mapRequiredComponents[requiredComponent] = to<int>(inputKwl.GetMetadataByKey(component), "converting metadata "+component+ " (PolygonsAnalysisImageFilter)");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment