# Region specification without leading zero leads to crash

**URL:** <https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497>\
**Category:** Q&A\
**Created:** [October 1, 2026, 6:13pm UTC](https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497 "2026-10-01T18:13:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thwbecker](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/thwbecker/32/1215_2.png) [@thwbecker](https://forum.generic-mapping-tools.org/u/thwbecker)\
**Post date:** [October 1, 2026, 6:13pm UTC](https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497/1 "2026-10-01T18:13:29Z")

</div>

Hi

when specifying a region as a float without leading zero, the parser will fail, e.g. as below.  
(github version). This is probably an uncommon use case, and not a high priority concern, but might be nice to have a more robust handling? (though I can also see how there are other special cases to consider). Thanks!

echo | xyz2grd -R.5/1/.5/1  
xyz2grd [ERROR]: Programming error. Please report the situation when it occurred.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 1, 2026, 6:36pm UTC](https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497/2 "2026-10-01T18:36:20Z")

</div>

Okay, I’ll see if I can implement it. Next time, feel free to open an issue on GitHub.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 1, 2026, 7:08pm UTC](https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497/3 "2026-10-01T19:08:05Z")

</div>

I made a PR with this. Could you test it?

> <https://github.com/GenericMappingTools/gmt/pull/9242>
>
> \*\*Description of proposed changes\*\*
> \`-R.5/1/.5/1\` fails with a "Programming err…or", while\` -R0.5/1/.5/1 \`works. Reported in the \[forum\](https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497).
> 
> This PR fixes the problem. 
> 
> \*\*How to test\*\*
> 
> This one-liner must create a figure:
> 
> \`gmt basemap -R.5/1/.5/1 -B.1 -png lixo\`
> 
> \*\*Done with Claude Sonnet 5.5, review with Opus 5.5.\*\*
> 
> @thwbecker, could you test it?

---

<div class="post-metadata">

**Author:** ![thwbecker](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/thwbecker/32/1215_2.png) [@thwbecker](https://forum.generic-mapping-tools.org/u/thwbecker)\
**Post date:** [October 1, 2026, 7:55pm UTC](https://forum.generic-mapping-tools.org/t/region-specification-without-leading-zero-leads-to-crash/6497/4 "2026-10-01T19:55:01Z")

</div>

> [@thwbecker](#):
>
> echo | xyz2grd -R.5/1/.5/1

Perfect, fixed.Thank you.
