You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on issue #507 I noticed that there is inconsistency in how numeric CLI args are handled. In particular when the value is represented as bundled short options such as -123.
In some cases the value is parsed by AST function strton64() indirectly via optget(). That function supports alternative forms such as base#value which is not supported by more familiar libc functions such as strtol(). In some cases both functions are applied to the same argument. Which is a problem if the value is recognized by strton64() but not strtol(). In other cases only the forms recognized by strol() and related functions are allowed.
This is unlikely to be an issue in practice because few people will ever try to do something like kill -2#11 $pid as an alternative to kill -3 $pid. Nonetheless, for consistency strton64() should always be used. Obviously coupled with appropriate error and bounds checking.
This is to remind me to try and unify the CLI numeric argument handling around strton64().
The text was updated successfully, but these errors were encountered:
While working on issue #507 I noticed that there is inconsistency in how numeric CLI args are handled. In particular when the value is represented as bundled short options such as
-123
.In some cases the value is parsed by AST function
strton64()
indirectly viaoptget()
. That function supports alternative forms such asbase#value
which is not supported by more familiar libc functions such asstrtol()
. In some cases both functions are applied to the same argument. Which is a problem if the value is recognized bystrton64()
but notstrtol()
. In other cases only the forms recognized bystrol()
and related functions are allowed.This is unlikely to be an issue in practice because few people will ever try to do something like
kill -2#11 $pid
as an alternative tokill -3 $pid
. Nonetheless, for consistencystrton64()
should always be used. Obviously coupled with appropriate error and bounds checking.This is to remind me to try and unify the CLI numeric argument handling around
strton64()
.The text was updated successfully, but these errors were encountered: