OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.8k stars 2.51k forks source link

argument parsing: throw error when non-numeric values provided to numeric arguments #10889

Open dbaston opened 1 day ago

dbaston commented 1 day ago

Feature description

In a handful of cases (e.g., gdalwarp -wm) the argument parsing code uses CPLAtofM to parse numeric arguments. This function returns a value of zero when given a non-numeric argument, causing invalid arguments to be silently replaced with zero.

Additional context

No response

rouault commented 1 day ago

This function returns a value of zero when given a non-numeric argument, causing invalid arguments to be silently replaced with zero.

like atof()... ?