Attention is currently required from: laforge, pespin.
pespin uploaded patch set #6 to this change.
vty: Allow using hex representations in cmd numeric ranges
Ranges can now be specified in hexadecimal range. In this case, only
hexadecimal values are accepted (prefixed with "0x").
In order to allow using a hexadecimal value as an input argument, the
command must specify the range in hexadecimal form.
This way all existing commands (decimal) won't get an hexadecimal value
unless they are further extended in the future, avoiding hard to notice
breakage due to use of stroul() without using base=0 or even worse,
using atoi() directly (which only understands decimal and provides no
error checking mechanism).
A command argument can be expanded to accept both decimal and hex in a
range by means of specifying both, example:
"mycmd (<0-255>|<0x0-0xff>)".
Related: OS#5631
Change-Id: Ia2b7fbbf5502c28374c21dbff548232680da27d4
---
M src/vty/command.c
M tests/vty/vty_test.c
M tests/vty/vty_test.err
M tests/vty/vty_test.ok
4 files changed, 182 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/19422/6
To view, visit change 19422. To unsubscribe, or for help writing mail filters, visit settings.